mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-24 16:57:02 +00:00
Merge pull request #531 from MellanoxBSP/upstream_work
Add: MSN3700/MSN3700C systems
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From ed87f7294ec22fe2e9780fec900f25954a720c8f Mon Sep 17 00:00:00 2001
|
||||
From: Vadim Pasternak <vadimp@mellanox.com>
|
||||
Date: Thu, 3 Jan 2019 18:02:06 +0000
|
||||
Subject: [PATCH 2/4] qsfp_sysfs: Fix dmidecode call
|
||||
|
||||
---
|
||||
drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
index 07cc7ea..c072b91 100644
|
||||
--- a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
+++ b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
@@ -231,14 +231,14 @@ mlxsw_qsfp_cpld_show(struct device *dev, struct device_attribute *attr,
|
||||
return sprintf(buf, "%u\n", version);
|
||||
}
|
||||
|
||||
-static int __init mlxsw_qsfp_dmi_set_cpld_num(const struct dmi_system_id *dmi)
|
||||
+static int mlxsw_qsfp_dmi_set_cpld_num(const struct dmi_system_id *dmi)
|
||||
{
|
||||
mlxsw_qsfp_cpld_num = MLXSW_QSFP_MAX_CPLD_NUM;
|
||||
|
||||
return 1;
|
||||
};
|
||||
|
||||
-static struct dmi_system_id mlxsw_qsfp_dmi_table[] __initdata = {
|
||||
+static const struct dmi_system_id mlxsw_qsfp_dmi_table[] = {
|
||||
{
|
||||
.callback = mlxsw_qsfp_dmi_set_cpld_num,
|
||||
.matches = {
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From c6a95c1ea4518a19cf46e8d0c844ae980df4c5da Mon Sep 17 00:00:00 2001
|
||||
From: Vadim Pasternak <vadimp@mellanox.com>
|
||||
Date: Thu, 3 Jan 2019 18:05:01 +0000
|
||||
Subject: [PATCH v1] mlxsw: qsfp_sysfs: Support extended port numbers for
|
||||
Spectrume2 chip
|
||||
|
||||
Add system type detection through DMI table in order to distinct between
|
||||
the systems supporting up to 64 and up to 128 ports.
|
||||
|
||||
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
|
||||
---
|
||||
drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 19 +++++++++++++++++--
|
||||
1 file changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
index c072b91..bee2a08 100644
|
||||
--- a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
+++ b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
@@ -47,7 +47,7 @@
|
||||
#define MLXSW_QSFP_SUB_PAGE_NUM 3
|
||||
#define MLXSW_QSFP_SUB_PAGE_SIZE 48
|
||||
#define MLXSW_QSFP_LAST_SUB_PAGE_SIZE 32
|
||||
-#define MLXSW_QSFP_MAX_NUM 64
|
||||
+#define MLXSW_QSFP_MAX_NUM 128
|
||||
#define MLXSW_QSFP_MIN_REQ_LEN 4
|
||||
#define MLXSW_QSFP_STATUS_VALID_TIME (120 * HZ)
|
||||
#define MLXSW_QSFP_MAX_CPLD_NUM 3
|
||||
@@ -88,6 +88,7 @@ struct mlxsw_qsfp {
|
||||
};
|
||||
|
||||
static int mlxsw_qsfp_cpld_num = MLXSW_QSFP_MIN_CPLD_NUM;
|
||||
+static int mlxsw_qsfp_num = MLXSW_QSFP_MAX_NUM / 2;
|
||||
|
||||
static int
|
||||
mlxsw_qsfp_query_module_eeprom(struct mlxsw_qsfp *mlxsw_qsfp, u8 index,
|
||||
@@ -238,6 +239,13 @@ static int mlxsw_qsfp_dmi_set_cpld_num(const struct dmi_system_id *dmi)
|
||||
return 1;
|
||||
};
|
||||
|
||||
+static int mlxsw_qsfp_dmi_set_qsfp_num(const struct dmi_system_id *dmi)
|
||||
+{
|
||||
+ mlxsw_qsfp_num = MLXSW_QSFP_MAX_NUM;
|
||||
+
|
||||
+ return 1;
|
||||
+};
|
||||
+
|
||||
static const struct dmi_system_id mlxsw_qsfp_dmi_table[] = {
|
||||
{
|
||||
.callback = mlxsw_qsfp_dmi_set_cpld_num,
|
||||
@@ -253,6 +261,13 @@ static const struct dmi_system_id mlxsw_qsfp_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "MSN27"),
|
||||
},
|
||||
},
|
||||
+ {
|
||||
+ .callback = mlxsw_qsfp_dmi_set_qsfp_num,
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "MSN37"),
|
||||
+ },
|
||||
+ },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(dmi, mlxsw_qsfp_dmi_table);
|
||||
@@ -283,7 +298,7 @@ int mlxsw_qsfp_init(struct mlxsw_core *mlxsw_core,
|
||||
mlxsw_qsfp->bus_info = mlxsw_bus_info;
|
||||
mlxsw_bus_info->dev->platform_data = mlxsw_qsfp;
|
||||
|
||||
- for (i = 1; i <= MLXSW_QSFP_MAX_NUM; i++) {
|
||||
+ for (i = 1; i <= mlxsw_qsfp_num; i++) {
|
||||
mlxsw_reg_pmlp_pack(pmlp_pl, i);
|
||||
err = mlxsw_reg_query(mlxsw_qsfp->core, MLXSW_REG(pmlp),
|
||||
pmlp_pl);
|
||||
--
|
||||
2.1.4
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
From d83d9b8a4813c6a626db151f9b9269d8c69a032a Mon Sep 17 00:00:00 2001
|
||||
From: Vadim Pasternak <vadimp@mellanox.com>
|
||||
Date: Sun, 6 Jan 2019 12:25:46 +0000
|
||||
Subject: [PATCH v1] mlxsw: qsfp_sysfs: Support port numbers initialization
|
||||
|
||||
Support port numbers initialization based on system type.
|
||||
|
||||
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
|
||||
---
|
||||
drivers/net/ethernet/mellanox/mlxsw/core.c | 20 +++++++++++++++++++-
|
||||
drivers/net/ethernet/mellanox/mlxsw/core.h | 10 +++-------
|
||||
drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 1 +
|
||||
3 files changed, 23 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
|
||||
index 10863d6..01987f0 100644
|
||||
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
|
||||
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
|
||||
@@ -114,12 +114,30 @@ struct mlxsw_core {
|
||||
struct mlxsw_resources resources;
|
||||
struct mlxsw_hwmon *hwmon;
|
||||
struct mlxsw_thermal *thermal;
|
||||
-struct mlxsw_qsfp *qsfp;
|
||||
+ struct mlxsw_qsfp *qsfp;
|
||||
struct mlxsw_core_port ports[MLXSW_PORT_MAX_PORTS];
|
||||
+ unsigned int max_ports;
|
||||
unsigned long driver_priv[0];
|
||||
/* driver_priv has to be always the last item */
|
||||
};
|
||||
|
||||
+#define MLXSW_PORT_MAX_PORTS_DEFAULT 0x40
|
||||
+unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core)
|
||||
+{
|
||||
+ if (mlxsw_core->max_ports)
|
||||
+ return mlxsw_core->max_ports;
|
||||
+ else
|
||||
+ return MLXSW_PORT_MAX_PORTS_DEFAULT;
|
||||
+}
|
||||
+EXPORT_SYMBOL(mlxsw_core_max_ports);
|
||||
+
|
||||
+void mlxsw_core_max_ports_set(struct mlxsw_core *mlxsw_core,
|
||||
+ unsigned int max_ports)
|
||||
+{
|
||||
+ mlxsw_core->max_ports = max_ports;
|
||||
+}
|
||||
+EXPORT_SYMBOL(mlxsw_core_max_ports_set);
|
||||
+
|
||||
void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core)
|
||||
{
|
||||
return mlxsw_core->driver_priv;
|
||||
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
|
||||
index 4fb104e..db27dd0 100644
|
||||
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
|
||||
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
|
||||
@@ -63,13 +63,9 @@ struct mlxsw_driver;
|
||||
struct mlxsw_bus;
|
||||
struct mlxsw_bus_info;
|
||||
|
||||
-#define MLXSW_PORT_MAX_PORTS_DEFAULT 0x40
|
||||
-static inline unsigned int
|
||||
-mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core)
|
||||
-{
|
||||
- return MLXSW_PORT_MAX_PORTS_DEFAULT;
|
||||
-}
|
||||
-
|
||||
+unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core);
|
||||
+void mlxsw_core_max_ports_set(struct mlxsw_core *mlxsw_core,
|
||||
+ unsigned int max_ports);
|
||||
void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core);
|
||||
|
||||
int mlxsw_core_driver_register(struct mlxsw_driver *mlxsw_driver);
|
||||
diff --git a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
index bee2a08..0781f16 100644
|
||||
--- a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
+++ b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
|
||||
@@ -298,6 +298,7 @@ int mlxsw_qsfp_init(struct mlxsw_core *mlxsw_core,
|
||||
mlxsw_qsfp->bus_info = mlxsw_bus_info;
|
||||
mlxsw_bus_info->dev->platform_data = mlxsw_qsfp;
|
||||
|
||||
+ mlxsw_core_max_ports_set(mlxsw_core, mlxsw_qsfp_num);
|
||||
for (i = 1; i <= mlxsw_qsfp_num; i++) {
|
||||
mlxsw_reg_pmlp_pack(pmlp_pl, i);
|
||||
err = mlxsw_reg_query(mlxsw_qsfp->core, MLXSW_REG(pmlp),
|
||||
--
|
||||
2.1.4
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,330 @@
|
||||
diff --git a/packages/base/any/kernels/4.9-lts/configs/x86_64-all/x86_64-all.config b/packages/base/any/kernels/4.9-lts/configs/x86_64-all/x86_64-all.config
|
||||
index 423e0d6..d468093 100644
|
||||
--- a/packages/base/any/kernels/4.9-lts/configs/x86_64-all/x86_64-all.config
|
||||
+++ b/packages/base/any/kernels/4.9-lts/configs/x86_64-all/x86_64-all.config
|
||||
@@ -162,7 +162,7 @@ CONFIG_CGROUP_FREEZER=y
|
||||
# CONFIG_CGROUP_HUGETLB is not set
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_PROC_PID_CPUSET=y
|
||||
-# CONFIG_CGROUP_DEVICE is not set
|
||||
+CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
# CONFIG_CGROUP_PERF is not set
|
||||
# CONFIG_CGROUP_DEBUG is not set
|
||||
@@ -802,7 +802,7 @@ CONFIG_IP_MROUTE=y
|
||||
CONFIG_IP_PIMSM_V1=y
|
||||
CONFIG_IP_PIMSM_V2=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
-# CONFIG_NET_UDP_TUNNEL is not set
|
||||
+CONFIG_NET_UDP_TUNNEL=y
|
||||
# CONFIG_NET_FOU is not set
|
||||
# CONFIG_NET_FOU_IP_TUNNELS is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
@@ -865,23 +865,40 @@ CONFIG_NET_PTP_CLASSIFY=y
|
||||
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
|
||||
CONFIG_NETFILTER=y
|
||||
# CONFIG_NETFILTER_DEBUG is not set
|
||||
-# CONFIG_NETFILTER_ADVANCED is not set
|
||||
+CONFIG_NETFILTER_ADVANCED=y
|
||||
+CONFIG_BRIDGE_NETFILTER=m
|
||||
|
||||
#
|
||||
# Core Netfilter Configuration
|
||||
#
|
||||
CONFIG_NETFILTER_INGRESS=y
|
||||
CONFIG_NETFILTER_NETLINK=y
|
||||
+# CONFIG_NETFILTER_NETLINK_ACCT is not set
|
||||
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
|
||||
CONFIG_NETFILTER_NETLINK_LOG=y
|
||||
CONFIG_NF_CONNTRACK=y
|
||||
CONFIG_NF_LOG_COMMON=m
|
||||
+# CONFIG_NF_CONNTRACK_MARK is not set
|
||||
CONFIG_NF_CONNTRACK_SECMARK=y
|
||||
CONFIG_NF_CONNTRACK_PROCFS=y
|
||||
+# CONFIG_NF_CONNTRACK_EVENTS is not set
|
||||
+# CONFIG_NF_CONNTRACK_TIMEOUT is not set
|
||||
+# CONFIG_NF_CONNTRACK_TIMESTAMP is not set
|
||||
+# CONFIG_NF_CT_PROTO_DCCP is not set
|
||||
+# CONFIG_NF_CT_PROTO_SCTP is not set
|
||||
+# CONFIG_NF_CT_PROTO_UDPLITE is not set
|
||||
+# CONFIG_NF_CONNTRACK_AMANDA is not set
|
||||
CONFIG_NF_CONNTRACK_FTP=y
|
||||
+# CONFIG_NF_CONNTRACK_H323 is not set
|
||||
CONFIG_NF_CONNTRACK_IRC=y
|
||||
# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
|
||||
+# CONFIG_NF_CONNTRACK_SNMP is not set
|
||||
+# CONFIG_NF_CONNTRACK_PPTP is not set
|
||||
+# CONFIG_NF_CONNTRACK_SANE is not set
|
||||
CONFIG_NF_CONNTRACK_SIP=y
|
||||
+# CONFIG_NF_CONNTRACK_TFTP is not set
|
||||
CONFIG_NF_CT_NETLINK=y
|
||||
+# CONFIG_NF_CT_NETLINK_TIMEOUT is not set
|
||||
# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set
|
||||
CONFIG_NF_NAT=m
|
||||
CONFIG_NF_NAT_NEEDED=y
|
||||
@@ -898,28 +915,142 @@ CONFIG_NETFILTER_XTABLES=y
|
||||
# Xtables combined modules
|
||||
#
|
||||
CONFIG_NETFILTER_XT_MARK=m
|
||||
+# CONFIG_NETFILTER_XT_CONNMARK is not set
|
||||
+# CONFIG_NETFILTER_XT_SET is not set
|
||||
|
||||
#
|
||||
# Xtables targets
|
||||
#
|
||||
+# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
|
||||
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
|
||||
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_HL is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_HMARK is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_LED is not set
|
||||
CONFIG_NETFILTER_XT_TARGET_LOG=m
|
||||
+# CONFIG_NETFILTER_XT_TARGET_MARK is not set
|
||||
CONFIG_NETFILTER_XT_NAT=m
|
||||
# CONFIG_NETFILTER_XT_TARGET_NETMAP is not set
|
||||
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
|
||||
+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
|
||||
# CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_TEE is not set
|
||||
+# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set
|
||||
CONFIG_NETFILTER_XT_TARGET_SECMARK=y
|
||||
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
|
||||
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
|
||||
|
||||
#
|
||||
# Xtables matches
|
||||
#
|
||||
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
|
||||
+# CONFIG_NETFILTER_XT_MATCH_BPF is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
|
||||
+# CONFIG_NETFILTER_XT_MATCH_CPU is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_ECN is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_ESP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_HL is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_IPVS is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_L2TP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_OSF is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
|
||||
CONFIG_NETFILTER_XT_MATCH_POLICY=y
|
||||
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_REALM is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set
|
||||
CONFIG_NETFILTER_XT_MATCH_STATE=y
|
||||
-# CONFIG_IP_SET is not set
|
||||
-# CONFIG_IP_VS is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_STRING is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_TIME is not set
|
||||
+# CONFIG_NETFILTER_XT_MATCH_U32 is not set
|
||||
+CONFIG_IP_SET=y
|
||||
+CONFIG_IP_SET_MAX=256
|
||||
+# CONFIG_IP_SET_BITMAP_IP is not set
|
||||
+# CONFIG_IP_SET_BITMAP_IPMAC is not set
|
||||
+# CONFIG_IP_SET_BITMAP_PORT is not set
|
||||
+# CONFIG_IP_SET_HASH_IP is not set
|
||||
+# CONFIG_IP_SET_HASH_IPMARK is not set
|
||||
+# CONFIG_IP_SET_HASH_IPPORT is not set
|
||||
+# CONFIG_IP_SET_HASH_IPPORTIP is not set
|
||||
+# CONFIG_IP_SET_HASH_IPPORTNET is not set
|
||||
+# CONFIG_IP_SET_HASH_MAC is not set
|
||||
+# CONFIG_IP_SET_HASH_NETPORTNET is not set
|
||||
+# CONFIG_IP_SET_HASH_NET is not set
|
||||
+# CONFIG_IP_SET_HASH_NETNET is not set
|
||||
+# CONFIG_IP_SET_HASH_NETPORT is not set
|
||||
+# CONFIG_IP_SET_HASH_NETIFACE is not set
|
||||
+# CONFIG_IP_SET_LIST_SET is not set
|
||||
+CONFIG_IP_VS=y
|
||||
+# CONFIG_IP_VS_IPV6 is not set
|
||||
+# CONFIG_IP_VS_DEBUG is not set
|
||||
+CONFIG_IP_VS_TAB_BITS=12
|
||||
+
|
||||
+#
|
||||
+# IPVS transport protocol load balancing support
|
||||
+#
|
||||
+# CONFIG_IP_VS_PROTO_TCP is not set
|
||||
+# CONFIG_IP_VS_PROTO_UDP is not set
|
||||
+# CONFIG_IP_VS_PROTO_AH_ESP is not set
|
||||
+# CONFIG_IP_VS_PROTO_ESP is not set
|
||||
+# CONFIG_IP_VS_PROTO_AH is not set
|
||||
+# CONFIG_IP_VS_PROTO_SCTP is not set
|
||||
+
|
||||
+#
|
||||
+# IPVS scheduler
|
||||
+#
|
||||
+# CONFIG_IP_VS_RR is not set
|
||||
+# CONFIG_IP_VS_WRR is not set
|
||||
+# CONFIG_IP_VS_LC is not set
|
||||
+# CONFIG_IP_VS_WLC is not set
|
||||
+# CONFIG_IP_VS_FO is not set
|
||||
+# CONFIG_IP_VS_OVF is not set
|
||||
+# CONFIG_IP_VS_LBLC is not set
|
||||
+# CONFIG_IP_VS_LBLCR is not set
|
||||
+# CONFIG_IP_VS_DH is not set
|
||||
+# CONFIG_IP_VS_SH is not set
|
||||
+# CONFIG_IP_VS_SED is not set
|
||||
+# CONFIG_IP_VS_NQ is not set
|
||||
+
|
||||
+#
|
||||
+# IPVS SH scheduler
|
||||
+#
|
||||
+CONFIG_IP_VS_SH_TAB_BITS=8
|
||||
+
|
||||
+#
|
||||
+# IPVS application helper
|
||||
+#
|
||||
+# CONFIG_IP_VS_NFCT is not set
|
||||
|
||||
#
|
||||
# IP: Netfilter Configuration
|
||||
@@ -935,12 +1066,24 @@ CONFIG_NF_NAT_MASQUERADE_IPV4=m
|
||||
# CONFIG_NF_NAT_PPTP is not set
|
||||
# CONFIG_NF_NAT_H323 is not set
|
||||
CONFIG_IP_NF_IPTABLES=y
|
||||
+# CONFIG_IP_NF_MATCH_AH is not set
|
||||
+# CONFIG_IP_NF_MATCH_ECN is not set
|
||||
+# CONFIG_IP_NF_MATCH_RPFILTER is not set
|
||||
+# CONFIG_IP_NF_MATCH_TTL is not set
|
||||
CONFIG_IP_NF_FILTER=y
|
||||
CONFIG_IP_NF_TARGET_REJECT=y
|
||||
+# CONFIG_IP_NF_TARGET_SYNPROXY is not set
|
||||
CONFIG_IP_NF_NAT=m
|
||||
CONFIG_IP_NF_TARGET_MASQUERADE=m
|
||||
+# CONFIG_IP_NF_TARGET_NETMAP is not set
|
||||
+# CONFIG_IP_NF_TARGET_REDIRECT is not set
|
||||
CONFIG_IP_NF_MANGLE=y
|
||||
+# CONFIG_IP_NF_TARGET_CLUSTERIP is not set
|
||||
+# CONFIG_IP_NF_TARGET_ECN is not set
|
||||
+# CONFIG_IP_NF_TARGET_TTL is not set
|
||||
# CONFIG_IP_NF_RAW is not set
|
||||
+# CONFIG_IP_NF_SECURITY is not set
|
||||
+# CONFIG_IP_NF_ARPTABLES is not set
|
||||
|
||||
#
|
||||
# IPv6: Netfilter Configuration
|
||||
@@ -950,23 +1093,43 @@ CONFIG_NF_CONNTRACK_IPV6=y
|
||||
# CONFIG_NF_DUP_IPV6 is not set
|
||||
CONFIG_NF_REJECT_IPV6=y
|
||||
CONFIG_NF_LOG_IPV6=m
|
||||
+# CONFIG_NF_NAT_IPV6 is not set
|
||||
CONFIG_IP6_NF_IPTABLES=y
|
||||
+# CONFIG_IP6_NF_MATCH_AH is not set
|
||||
+# CONFIG_IP6_NF_MATCH_EUI64 is not set
|
||||
+# CONFIG_IP6_NF_MATCH_FRAG is not set
|
||||
+# CONFIG_IP6_NF_MATCH_OPTS is not set
|
||||
+# CONFIG_IP6_NF_MATCH_HL is not set
|
||||
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
|
||||
+# CONFIG_IP6_NF_MATCH_MH is not set
|
||||
+# CONFIG_IP6_NF_MATCH_RPFILTER is not set
|
||||
+# CONFIG_IP6_NF_MATCH_RT is not set
|
||||
+# CONFIG_IP6_NF_TARGET_HL is not set
|
||||
CONFIG_IP6_NF_FILTER=y
|
||||
CONFIG_IP6_NF_TARGET_REJECT=y
|
||||
+# CONFIG_IP6_NF_TARGET_SYNPROXY is not set
|
||||
CONFIG_IP6_NF_MANGLE=y
|
||||
# CONFIG_IP6_NF_RAW is not set
|
||||
+# CONFIG_IP6_NF_SECURITY is not set
|
||||
+# CONFIG_IP6_NF_NAT is not set
|
||||
+# CONFIG_BRIDGE_NF_EBTABLES is not set
|
||||
# CONFIG_IP_DCCP is not set
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_RDS is not set
|
||||
# CONFIG_TIPC is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_L2TP is not set
|
||||
-# CONFIG_BRIDGE is not set
|
||||
+CONFIG_STP=y
|
||||
+CONFIG_BRIDGE=y
|
||||
+CONFIG_BRIDGE_IGMP_SNOOPING=y
|
||||
+CONFIG_BRIDGE_VLAN_FILTERING=y
|
||||
CONFIG_HAVE_NET_DSA=y
|
||||
# CONFIG_NET_DSA is not set
|
||||
-# CONFIG_VLAN_8021Q is not set
|
||||
+CONFIG_VLAN_8021Q=m
|
||||
+# CONFIG_VLAN_8021Q_GVRP is not set
|
||||
+# CONFIG_VLAN_8021Q_MVRP is not set
|
||||
# CONFIG_DECNET is not set
|
||||
+CONFIG_LLC=y
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
@@ -1028,6 +1191,7 @@ CONFIG_NET_EMATCH_STACK=32
|
||||
# CONFIG_NET_EMATCH_U32 is not set
|
||||
# CONFIG_NET_EMATCH_META is not set
|
||||
# CONFIG_NET_EMATCH_TEXT is not set
|
||||
+# CONFIG_NET_EMATCH_IPSET is not set
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
# CONFIG_NET_ACT_POLICE is not set
|
||||
# CONFIG_NET_ACT_GACT is not set
|
||||
@@ -1053,7 +1217,7 @@ CONFIG_DNS_RESOLVER=y
|
||||
# CONFIG_MPLS is not set
|
||||
# CONFIG_HSR is not set
|
||||
# CONFIG_NET_SWITCHDEV is not set
|
||||
-# CONFIG_NET_L3_MASTER_DEV is not set
|
||||
+CONFIG_NET_L3_MASTER_DEV=y
|
||||
# CONFIG_NET_NCSI is not set
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
@@ -1463,22 +1627,27 @@ CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=y
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
-# CONFIG_DUMMY is not set
|
||||
+CONFIG_DUMMY=y
|
||||
# CONFIG_EQUALIZER is not set
|
||||
# CONFIG_NET_FC is not set
|
||||
# CONFIG_IFB is not set
|
||||
# CONFIG_NET_TEAM is not set
|
||||
-# CONFIG_MACVLAN is not set
|
||||
-# CONFIG_VXLAN is not set
|
||||
-# CONFIG_MACSEC is not set
|
||||
+CONFIG_MACVLAN=y
|
||||
+CONFIG_MACVTAP=m
|
||||
+CONFIG_IPVLAN=m
|
||||
+CONFIG_VXLAN=y
|
||||
+CONFIG_GENEVE=m
|
||||
+CONFIG_GTP=m
|
||||
+CONFIG_MACSEC=m
|
||||
CONFIG_NETCONSOLE=y
|
||||
CONFIG_NETPOLL=y
|
||||
CONFIG_NET_POLL_CONTROLLER=y
|
||||
-CONFIG_TUN=y
|
||||
+CONFIG_TUN=m
|
||||
# CONFIG_TUN_VNET_CROSS_LE is not set
|
||||
CONFIG_VETH=y
|
||||
CONFIG_VIRTIO_NET=y
|
||||
# CONFIG_NLMON is not set
|
||||
+# CONFIG_NET_VRF is not set
|
||||
# CONFIG_ARCNET is not set
|
||||
|
||||
#
|
||||
@@ -16,3 +16,8 @@ driver-add-the-support-max6620.patch
|
||||
0013-Mellanox-backport-patchwork-from-kernels-4.17-4.19.patch
|
||||
0014-platform-x86-mlx-platform-backport-from-4.19.patch
|
||||
0015-platform-x86-mlx-platform-Add-support-for-register-a.patch
|
||||
0016-qsfp_sysfs-Fix-dmidecode-call.patch
|
||||
0017-mlxsw-qsfp_sysfs-Support-extended-port-numbers-for-S.patch
|
||||
0018-mlxsw-thermal-monitoring-amendments.patch
|
||||
0020-mlxsw-qsfp_sysfs-Support-port-numbers-initialization.patch
|
||||
0021-mlxsw-Align-code-with-kernel-v-5.0.patch
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
/* 1 -without eeprom, 2 - with eeprom */
|
||||
#define PSU_TYPE_1 1
|
||||
#define PSU_TYPE_2 2
|
||||
#define PSU_TYPE_3 3
|
||||
|
||||
#define FAN_MODEL "MEC012579"
|
||||
|
||||
@@ -137,9 +138,12 @@ typedef struct mlnx_platform_info_s {
|
||||
|
||||
#define PSU1_ID 1
|
||||
#define PSU2_ID 2
|
||||
#define PSU_MODULE_PREFIX "/bsp/module/psu%d_%s"
|
||||
#define PSU_POWER_PREFIX "/bsp/power/psu%d_%s"
|
||||
#define IDPROM_PATH "/bsp/eeprom/%s%d_info"
|
||||
#define HW_MANAGEMENT_PATH "/var/run/hw-management"
|
||||
#define QSFP_PATH HW_MANAGEMENT_PATH"/qsfp"
|
||||
#define THERMAL_PATH "/var/run/hw-management/thermal"
|
||||
#define PSU_MODULE_PREFIX THERMAL_PATH"/psu%d_%s"
|
||||
#define PSU_POWER_PREFIX HW_MANAGEMENT_PATH"/power/psu%d_%s"
|
||||
#define IDPROM_PATH HW_MANAGEMENT_PATH"/eeprom/%s%d_info"
|
||||
|
||||
typedef enum psu_type {
|
||||
PSU_TYPE_UNKNOWN,
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
#include "mlnx_common/mlnx_common.h"
|
||||
#include "mlnx_common_log.h"
|
||||
|
||||
#define PREFIX_PATH "/bsp/fan/"
|
||||
#define PREFIX_MODULE_PATH "/bsp/module/"
|
||||
|
||||
#define FAN_STATUS_OK 1
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
@@ -144,7 +141,7 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
/* get fan status */
|
||||
fru_index = (local_id + mlnx_platform_info->fan_per_module -1) / mlnx_platform_info->fan_per_module;
|
||||
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_MODULE_PATH, mlnx_platform_info->fan_fnames[fru_index].status);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[fru_index].status);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -158,7 +155,7 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
info->status |= ONLP_FAN_STATUS_PRESENT;
|
||||
|
||||
/* get fan speed */
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_PATH, mlnx_platform_info->fan_fnames[local_id].r_speed_get);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[local_id].r_speed_get);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -172,14 +169,14 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
|
||||
if (ONLP_FAN_CAPS_GET_PERCENTAGE & info->caps) {
|
||||
/* get fan min speed */
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_PATH, mlnx_platform_info->fan_fnames[local_id].min);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[local_id].min);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
mlnx_platform_info->min_fan_speed[local_id] = r_val;
|
||||
|
||||
/* get fan max speed */
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_PATH, mlnx_platform_info->fan_fnames[local_id].max);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[local_id].max);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -214,7 +211,7 @@ _onlp_fani_info_get_fan_on_psu(int local_id, int psu_id, onlp_fan_info_t* info)
|
||||
mlnx_platform_info_t* mlnx_platform_info = get_platform_info();
|
||||
/* get fan status
|
||||
*/
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_MODULE_PATH, mlnx_platform_info->fan_fnames[local_id].status);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[local_id].status);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -228,7 +225,7 @@ _onlp_fani_info_get_fan_on_psu(int local_id, int psu_id, onlp_fan_info_t* info)
|
||||
|
||||
/* get fan speed
|
||||
*/
|
||||
ret = onlp_file_read_int(&r_val, "%s%s", PREFIX_PATH, mlnx_platform_info->fan_fnames[local_id].r_speed_get);
|
||||
ret = onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[local_id].r_speed_get);
|
||||
if (ret < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -325,7 +322,7 @@ onlp_fani_rpm_set(onlp_oid_t id, int rpm)
|
||||
|
||||
snprintf(r_data, sizeof(r_data), "%d", (int)temp);
|
||||
nbytes = strnlen(r_data, sizeof(r_data));
|
||||
rv = onlp_file_write((uint8_t*)r_data, nbytes, "%s%s", PREFIX_PATH,
|
||||
rv = onlp_file_write((uint8_t*)r_data, nbytes, "%s/%s", THERMAL_PATH,
|
||||
mlnx_platform_info->fan_fnames[local_id].r_speed_set);
|
||||
if (rv < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
@@ -378,7 +375,7 @@ onlp_fani_percentage_set(onlp_oid_t id, int p)
|
||||
|
||||
snprintf(r_data, sizeof(r_data), "%d", (int)temp);
|
||||
nbytes = strnlen(r_data, sizeof(r_data));
|
||||
rv = onlp_file_write((uint8_t*)r_data, nbytes, "%s%s", PREFIX_PATH,
|
||||
rv = onlp_file_write((uint8_t*)r_data, nbytes, "%s/%s", THERMAL_PATH,
|
||||
mlnx_platform_info->fan_fnames[local_id].r_speed_set);
|
||||
if (rv < 0) {
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
@@ -394,7 +391,7 @@ onlp_fani_get_min_rpm(int id)
|
||||
|
||||
mlnx_platform_info_t* mlnx_platform_info = get_platform_info();
|
||||
|
||||
if (onlp_file_read_int(&r_val, "%s%s", PREFIX_PATH, mlnx_platform_info->fan_fnames[id].min) < 0)
|
||||
if (onlp_file_read_int(&r_val, "%s/%s", THERMAL_PATH, mlnx_platform_info->fan_fnames[id].min) < 0)
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
|
||||
return r_val;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
|
||||
#define MAX_NUM_OF_CPLD 3
|
||||
#define PREFIX_PATH_ON_CPLD_DEV "/bsp/cpld"
|
||||
#define PREFIX_PATH_ON_CPLD_DEV HW_MANAGEMENT_PATH"/system"
|
||||
|
||||
mlnx_platform_info_t* get_platform_info(void);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <onlp/platformi/ledi.h>
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
|
||||
#define prefix_path "/bsp/led/led_"
|
||||
#define prefix_path HW_MANAGEMENT_PATH"/led/led_"
|
||||
#define driver_value_len 50
|
||||
|
||||
#define LED_MODE_OFF "none"
|
||||
|
||||
@@ -188,6 +188,63 @@ _psu_info_get_type2(onlp_psu_info_t* info)
|
||||
return psu_read_eeprom(index, info, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
_psu_info_get_type3(onlp_psu_info_t* info)
|
||||
{
|
||||
int val = 0;
|
||||
int index = ONLP_OID_ID_GET(info->hdr.id);
|
||||
|
||||
mlnx_platform_info_t* mlnx_platform_info = get_platform_info();
|
||||
/* Set capability
|
||||
*/
|
||||
info->caps = ONLP_PSU_CAPS_AC;
|
||||
|
||||
if (info->status & ONLP_PSU_STATUS_FAILED) {
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
/* Set the associated oid_table */
|
||||
info->hdr.coids[0] = ONLP_FAN_ID_CREATE(index + mlnx_platform_info->fan_num);
|
||||
info->hdr.coids[1] = ONLP_THERMAL_ID_CREATE(index + mlnx_platform_info->thermal_num);
|
||||
|
||||
/* Read voltage, current and power */
|
||||
if (psu_power_info_get(index, "volt_in", &val) == 0 &&
|
||||
0 != val) {
|
||||
info->mvin = val;
|
||||
info->caps |= ONLP_PSU_CAPS_VIN;
|
||||
|
||||
if (psu_power_info_get(index, "volt_out2", &val) == 0) {
|
||||
info->mvout = val;
|
||||
info->caps |= ONLP_PSU_CAPS_VOUT;
|
||||
}
|
||||
|
||||
if (psu_power_info_get(index, "curr_in", &val) == 0) {
|
||||
info->miin = val;
|
||||
info->caps |= ONLP_PSU_CAPS_IIN;
|
||||
}
|
||||
|
||||
if (psu_power_info_get(index, "curr", &val) == 0) {
|
||||
info->miout = val;
|
||||
info->caps |= ONLP_PSU_CAPS_IOUT;
|
||||
}
|
||||
|
||||
if (psu_power_info_get(index, "power_in", &val) == 0) {
|
||||
info->mpin = val;
|
||||
info->caps |= ONLP_PSU_CAPS_PIN;
|
||||
}
|
||||
|
||||
if (psu_power_info_get(index, "power", &val) == 0) {
|
||||
info->mpout = val;
|
||||
info->caps |= ONLP_PSU_CAPS_POUT;
|
||||
}
|
||||
} else {
|
||||
info->status |= ONLP_PSU_STATUS_FAILED;
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
return psu_read_eeprom(index, info, NULL);
|
||||
}
|
||||
|
||||
int _psu_info_get(onlp_psu_info_t* info)
|
||||
{
|
||||
int res;
|
||||
@@ -199,6 +256,9 @@ int _psu_info_get(onlp_psu_info_t* info)
|
||||
case PSU_TYPE_2:
|
||||
res=_psu_info_get_type2(info);
|
||||
break;
|
||||
case PSU_TYPE_3:
|
||||
res=_psu_info_get_type3(info);
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -74,16 +74,16 @@ static char*
|
||||
mc_sfp_get_port_path(int port, char *node_name)
|
||||
{
|
||||
if (node_name)
|
||||
sprintf(sfp_node_path, "/bsp/qsfp/qsfp%d%s", port, node_name);
|
||||
sprintf(sfp_node_path, "%s/qsfp%d%s", QSFP_PATH, port, node_name);
|
||||
else
|
||||
sprintf(sfp_node_path, "/bsp/qsfp/qsfp%d", port);
|
||||
sprintf(sfp_node_path, "%s/qsfp%d", QSFP_PATH, port);
|
||||
return sfp_node_path;
|
||||
}
|
||||
|
||||
static char*
|
||||
mc_sfp_convert_i2c_path(int port, int devaddr)
|
||||
{
|
||||
sprintf(sfp_node_path, "/bsp/qsfp/qsfp%d", port);
|
||||
sprintf(sfp_node_path, "%s/qsfp%d", QSFP_PATH, port);
|
||||
return sfp_node_path;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <onlp/platformi/thermali.h>
|
||||
#include "mlnx_common/mlnx_common.h"
|
||||
|
||||
#define prefix_path "/bsp/thermal"
|
||||
#define prefix_path HW_MANAGEMENT_PATH"/thermal"
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
do { \
|
||||
|
||||
@@ -51,7 +51,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core1",
|
||||
"cpu_pack",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb",
|
||||
"psu1",
|
||||
"psu2"
|
||||
|
||||
@@ -51,7 +51,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core2",
|
||||
"cpu_core3",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb"
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core2",
|
||||
"cpu_core3",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb"
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core1",
|
||||
"cpu_pack",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb",
|
||||
"psu1",
|
||||
"psu2"
|
||||
|
||||
@@ -38,7 +38,7 @@ enum onlp_thermal_id
|
||||
THERMAL_CPU_CORE_1,
|
||||
THERMAL_CPU_PACK,
|
||||
THERMAL_ASIC,
|
||||
THERMAL_BOAR_AMB,
|
||||
THERMAL_BOARD_AMB,
|
||||
THERMAL_PORT,
|
||||
THERMAL_ON_PSU1,
|
||||
THERMAL_ON_PSU2,
|
||||
@@ -51,7 +51,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core1",
|
||||
"cpu_pack",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb",
|
||||
"psu1",
|
||||
"psu2"
|
||||
@@ -76,7 +76,7 @@ static onlp_thermal_info_t tinfo[] = {
|
||||
ONLP_THERMAL_STATUS_PRESENT,
|
||||
ONLP_THERMAL_CAPS_ALL, 0, ASIC_THERMAL_THRESHOLD_INIT_DEFAULTS
|
||||
},
|
||||
{ { ONLP_THERMAL_ID_CREATE(THERMAL_BOAR_AMB), "Board AMB Thermal Sensor", 0},
|
||||
{ { 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}
|
||||
},
|
||||
|
||||
@@ -53,7 +53,7 @@ static char* thermal_fnames[] = /* must map with onlp_thermal_id */
|
||||
"cpu_core2",
|
||||
"cpu_core3",
|
||||
"asic",
|
||||
"board_amb",
|
||||
"fan_amb",
|
||||
"port_amb",
|
||||
"psu1",
|
||||
"psu2"
|
||||
|
||||
@@ -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-msn3700
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn3700 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-msn3700
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF mlnx_common x86_64_mlnx_msn3700 onlplib
|
||||
DEPENDMODULE_HEADERS := sff
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
SHAREDLIB := libonlp-x86-64-mlnx-msn3700.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-msn3700-r0 module.
|
||||
#
|
||||
# Autogenerated 2015-12-23 23:45:22.249911
|
||||
#
|
||||
###############################################################################
|
||||
libonlp-x86-64-mlnx-msn3700-r0_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Inclusive Makefile for the libonlp-x86-64-mlnx-msn3700 module.
|
||||
#
|
||||
# Autogenerated 2016-10-13 22:58:39.095824
|
||||
#
|
||||
###############################################################################
|
||||
libonlp-x86-64-mlnx-msn3700_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Inclusive Makefile for the x86_64_mlnx_msn3700 module.
|
||||
#
|
||||
# Autogenerated 2015-12-23 23:45:22.262891
|
||||
#
|
||||
###############################################################################
|
||||
x86_64_mlnx_msn3700_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_msn3700 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_msn3700
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
include ../../init.mk
|
||||
MODULE := x86_64_mlnx_msn3700
|
||||
AUTOMODULE := x86_64_mlnx_msn3700
|
||||
include $(BUILDER)/definemodule.mk
|
||||
@@ -0,0 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_mlnx_msn3700 README
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_mlnx_msn3700 Autogeneration
|
||||
#
|
||||
###############################################################################
|
||||
x86_64_mlnx_msn3700_AUTO_DEFS := module/auto/x86_64_mlnx_msn3700.yml
|
||||
x86_64_mlnx_msn3700_AUTO_DIRS := module/inc/x86_64_mlnx_msn3700 module/src
|
||||
include $(BUILDER)/auto.mk
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_mlnx_msn3700 Autogeneration Definitions.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
cdefs: &cdefs
|
||||
- X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING:
|
||||
doc: "Include or exclude logging."
|
||||
default: 1
|
||||
- X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT:
|
||||
doc: "Default enabled log options."
|
||||
default: AIM_LOG_OPTIONS_DEFAULT
|
||||
- X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT:
|
||||
doc: "Default enabled log bits."
|
||||
default: AIM_LOG_BITS_DEFAULT
|
||||
- X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT:
|
||||
doc: "Default enabled custom log bits."
|
||||
default: 0
|
||||
- X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB:
|
||||
doc: "Default all porting macros to use the C standard libraries."
|
||||
default: 1
|
||||
- X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS:
|
||||
doc: "Include standard library headers for stdlib porting macros."
|
||||
default: x86_64_mlnx_msn3700_CONFIG_PORTING_STDLIB
|
||||
- X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI:
|
||||
doc: "Include generic uCli support."
|
||||
default: 0
|
||||
- X86_64_MLNX_MSN3700_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_MSN3700_CONFIG_HEADER:
|
||||
defs: *cdefs
|
||||
basename: x86_64_mlnx_msn3700_config
|
||||
|
||||
portingmacro:
|
||||
x86_64_mlnx_msn3700:
|
||||
macros:
|
||||
- malloc
|
||||
- free
|
||||
- memset
|
||||
- memcpy
|
||||
- strncpy
|
||||
- vsnprintf
|
||||
- snprintf
|
||||
- strlen
|
||||
@@ -0,0 +1,14 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_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_msn3700 Configuration Header
|
||||
*
|
||||
* @addtogroup x86_64_mlnx_msn3700-config
|
||||
* @{
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_MLNX_MSN3700_CONFIG_H__
|
||||
#define __X86_64_MLNX_MSN3700_CONFIG_H__
|
||||
|
||||
#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG
|
||||
#include <global_custom_config.h>
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_INCLUDE_CUSTOM_CONFIG
|
||||
#include <x86_64_mlnx_msn3700_custom_config.h>
|
||||
#endif
|
||||
|
||||
/* <auto.start.cdefs(X86_64_MLNX_MSN3700_CONFIG_HEADER).header> */
|
||||
#include <AIM/aim.h>
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING
|
||||
*
|
||||
* Include or exclude logging. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
*
|
||||
* Default enabled log options. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled log bits. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled custom log bits. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB
|
||||
*
|
||||
* Default all porting macros to use the C standard libraries. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
*
|
||||
* Include standard library headers for stdlib porting macros. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI
|
||||
*
|
||||
* Include generic uCli support. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
*
|
||||
* Assume chassis fan direction is the same as the PSU fan direction. */
|
||||
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
#define X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* All compile time options can be queried or displayed
|
||||
*/
|
||||
|
||||
/** Configuration settings structure. */
|
||||
typedef struct x86_64_mlnx_msn3700_config_settings_s {
|
||||
/** name */
|
||||
const char* name;
|
||||
/** value */
|
||||
const char* value;
|
||||
} x86_64_mlnx_msn3700_config_settings_t;
|
||||
|
||||
/** Configuration settings table. */
|
||||
/** x86_64_mlnx_msn3700_config_settings table. */
|
||||
extern x86_64_mlnx_msn3700_config_settings_t x86_64_mlnx_msn3700_config_settings[];
|
||||
|
||||
/**
|
||||
* @brief Lookup a configuration setting.
|
||||
* @param setting The name of the configuration option to lookup.
|
||||
*/
|
||||
const char* x86_64_mlnx_msn3700_config_lookup(const char* setting);
|
||||
|
||||
/**
|
||||
* @brief Show the compile-time configuration.
|
||||
* @param pvs The output stream.
|
||||
*/
|
||||
int x86_64_mlnx_msn3700_config_show(struct aim_pvs_s* pvs);
|
||||
|
||||
/* <auto.end.cdefs(X86_64_MLNX_MSN3700_CONFIG_HEADER).header> */
|
||||
|
||||
#include "x86_64_mlnx_msn3700_porting.h"
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3700_CONFIG_H__ */
|
||||
/* @} */
|
||||
@@ -0,0 +1,26 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* x86_64_mlnx_msn3700 Doxygen Header
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_MLNX_MSN3700_DOX_H__
|
||||
#define __X86_64_MLNX_MSN3700_DOX_H__
|
||||
|
||||
/**
|
||||
* @defgroup x86_64_mlnx_msn3700 x86_64_mlnx_msn3700 - x86_64_mlnx_msn3700 Description
|
||||
*
|
||||
|
||||
The documentation overview for this module should go here.
|
||||
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup x86_64_mlnx_msn3700-x86_64_mlnx_msn3700 Public Interface
|
||||
* @defgroup x86_64_mlnx_msn3700-config Compile Time Configuration
|
||||
* @defgroup x86_64_mlnx_msn3700-porting Porting Macros
|
||||
*
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3700_DOX_H__ */
|
||||
@@ -0,0 +1,107 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* @file
|
||||
* @brief x86_64_mlnx_msn3700 Porting Macros.
|
||||
*
|
||||
* @addtogroup x86_64_mlnx_msn3700-porting
|
||||
* @{
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_MLNX_MSN3700_PORTING_H__
|
||||
#define __X86_64_MLNX_MSN3700_PORTING_H__
|
||||
|
||||
|
||||
/* <auto.start.portingmacro(ALL).define> */
|
||||
#if X86_64_MLNX_MSN3700_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_MSN3700_MALLOC
|
||||
#if defined(GLOBAL_MALLOC)
|
||||
#define X86_64_MLNX_MSN3700_MALLOC GLOBAL_MALLOC
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_MALLOC malloc
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_MALLOC is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_FREE
|
||||
#if defined(GLOBAL_FREE)
|
||||
#define X86_64_MLNX_MSN3700_FREE GLOBAL_FREE
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_FREE free
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_FREE is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_MEMSET
|
||||
#if defined(GLOBAL_MEMSET)
|
||||
#define X86_64_MLNX_MSN3700_MEMSET GLOBAL_MEMSET
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_MEMSET memset
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_MEMSET is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_MEMCPY
|
||||
#if defined(GLOBAL_MEMCPY)
|
||||
#define X86_64_MLNX_MSN3700_MEMCPY GLOBAL_MEMCPY
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_MEMCPY memcpy
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_MEMCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_STRNCPY
|
||||
#if defined(GLOBAL_STRNCPY)
|
||||
#define X86_64_MLNX_MSN3700_STRNCPY GLOBAL_STRNCPY
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_STRNCPY strncpy
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_STRNCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_VSNPRINTF
|
||||
#if defined(GLOBAL_VSNPRINTF)
|
||||
#define X86_64_MLNX_MSN3700_VSNPRINTF GLOBAL_VSNPRINTF
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_VSNPRINTF vsnprintf
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_VSNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_SNPRINTF
|
||||
#if defined(GLOBAL_SNPRINTF)
|
||||
#define X86_64_MLNX_MSN3700_SNPRINTF GLOBAL_SNPRINTF
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_SNPRINTF snprintf
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_SNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef X86_64_MLNX_MSN3700_STRLEN
|
||||
#if defined(GLOBAL_STRLEN)
|
||||
#define X86_64_MLNX_MSN3700_STRLEN GLOBAL_STRLEN
|
||||
#elif X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB == 1
|
||||
#define X86_64_MLNX_MSN3700_STRLEN strlen
|
||||
#else
|
||||
#error The macro X86_64_MLNX_MSN3700_STRLEN is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* <auto.end.portingmacro(ALL).define> */
|
||||
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3700_PORTING_H__ */
|
||||
/* @} */
|
||||
@@ -0,0 +1,10 @@
|
||||
###############################################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
x86_64_mlnx_msn3700_INCLUDES := -I $(THIS_DIR)inc
|
||||
x86_64_mlnx_msn3700_INTERNAL_INCLUDES := -I $(THIS_DIR)src
|
||||
x86_64_mlnx_msn3700_DEPENDMODULE_ENTRIES := init:x86_64_mlnx_msn3700 ucli:x86_64_mlnx_msn3700
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Local source generation targets.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
ucli:
|
||||
@../../../../tools/uclihandlers.py x86_64_mlnx_msn3700_ucli.c
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/************************************************************
|
||||
* <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_4_ON_MAIN_BOARD 4
|
||||
#define FAN_5_ON_MAIN_BOARD 5
|
||||
#define FAN_6_ON_MAIN_BOARD 6
|
||||
#define FAN_7_ON_MAIN_BOARD 7
|
||||
#define FAN_8_ON_MAIN_BOARD 8
|
||||
#define FAN_9_ON_MAIN_BOARD 9
|
||||
#define FAN_10_ON_MAIN_BOARD 10
|
||||
#define FAN_11_ON_MAIN_BOARD 11
|
||||
#define FAN_12_ON_MAIN_BOARD 12
|
||||
#define FAN_1_ON_PSU1 13
|
||||
#define FAN_1_ON_PSU2 14
|
||||
|
||||
#define FIRST_PSU_FAN_ID 13
|
||||
|
||||
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_MAIN_BOARD(PROJECT_NAME, FAN_5_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_6_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_7_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_8_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_9_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_10_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_11_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_12_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_MAIN_BOARD(5),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(6),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(7),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(8),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(9),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(10),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(11),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(12),
|
||||
MAKE_FAN_INFO_NODE_ON_PSU(1,1),
|
||||
MAKE_FAN_INFO_NODE_ON_PSU(2,1)
|
||||
};
|
||||
|
||||
static fan_path_T fan_path_c[] = /* 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_MAIN_BOARD(PROJECT_NAME, FAN_5_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_6_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_7_ON_MAIN_BOARD),
|
||||
MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_8_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_c[] = {
|
||||
{ }, /* 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_MAIN_BOARD(5),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(6),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(7),
|
||||
MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(8),
|
||||
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();
|
||||
if(!strcmp(mlnx_platform_info->onl_platform_name, "x86-64-mlnx_msn3700c-r0")) {
|
||||
mlnx_platform_info->finfo = finfo_c;
|
||||
mlnx_platform_info->fan_fnames = fan_path_c;
|
||||
} else {
|
||||
mlnx_platform_info->finfo = finfo;
|
||||
mlnx_platform_info->fan_fnames = fan_path;
|
||||
}
|
||||
|
||||
mlnx_platform_info->min_fan_speed = min_fan_speed;
|
||||
mlnx_platform_info->max_fan_speed = max_fan_speed;
|
||||
mlnx_platform_info->fan_type = FAN_TYPE_NO_EEPROM;
|
||||
mlnx_platform_info->fan_per_module = 2;
|
||||
mlnx_platform_info->first_psu_fan_id = FIRST_PSU_FAN_ID;
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/************************************************************
|
||||
* <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",
|
||||
"fan4",
|
||||
"fan5",
|
||||
"fan6",
|
||||
"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 (1-2) )", 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 (3-4) )", 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 (5-6) )", 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_FAN4), "Chassis LED 5 (FAN5 (7-8) )", 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_FAN5), "Chassis LED 6 (FAN5 (9-10) )", 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_FAN6), "Chassis LED 7 (FAN6 (11-12) )", 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,
|
||||
},
|
||||
};
|
||||
|
||||
static char* file_names_c[] = /* 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_c[] =
|
||||
{
|
||||
{ }, /* 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 (1-2) )", 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 (3-4) )", 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 (5-6) )", 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_FAN4), "Chassis LED 5 (FAN4 (7-8) )", 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 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_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();
|
||||
|
||||
if(!strcmp(mlnx_platform_info->onl_platform_name, "x86-64-mlnx_msn3700c-r0")) {
|
||||
mlnx_platform_info->linfo = linfo_c;
|
||||
mlnx_platform_info->led_fnames = file_names_c;
|
||||
} else {
|
||||
mlnx_platform_info->linfo = linfo;
|
||||
mlnx_platform_info->led_fnames = file_names;
|
||||
}
|
||||
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
LIBRARY := x86_64_mlnx_msn3700
|
||||
$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
include $(BUILDER)/lib.mk
|
||||
@@ -0,0 +1,47 @@
|
||||
/************************************************************
|
||||
* <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_msn3700_log.h"
|
||||
|
||||
#define CHASSIS_PSU_COUNT 2
|
||||
#define CPLD_COUNT 3
|
||||
#define SFP_PORT_COUNT 32
|
||||
|
||||
#define CHASSIS_TOTAL_FAN_COUNT 14
|
||||
#define CHASSIS_TOTAL_THERMAL_COUNT 10
|
||||
#define CHASSIS_FAN_COUNT (CHASSIS_TOTAL_FAN_COUNT - CHASSIS_PSU_COUNT)
|
||||
#define CHASSIS_THERMAL_COUNT (CHASSIS_TOTAL_THERMAL_COUNT - CHASSIS_PSU_COUNT)
|
||||
#define CHASSIS_LED_COUNT 8
|
||||
|
||||
#define CHASSIS_C_TOTAL_FAN_COUNT 10
|
||||
#define CHASSIS_C_TOTAL_THERMAL_COUNT 8
|
||||
#define CHASSIS_C_FAN_COUNT (CHASSIS_C_TOTAL_FAN_COUNT - CHASSIS_PSU_COUNT)
|
||||
#define CHASSIS_C_THERMAL_COUNT (CHASSIS_C_TOTAL_THERMAL_COUNT - CHASSIS_PSU_COUNT)
|
||||
#define CHASSIS_C_LED_COUNT 6
|
||||
|
||||
|
||||
#endif /* __PLATFORM_LIB_H__ */
|
||||
@@ -0,0 +1,99 @@
|
||||
/************************************************************
|
||||
* <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_msn3700_int.h"
|
||||
#include "x86_64_mlnx_msn3700_log.h"
|
||||
|
||||
static const char* __ONL_PLATFORM_NAME = NULL;
|
||||
|
||||
int mc_get_platform_info(mlnx_platform_info_t* mlnx_platform)
|
||||
{
|
||||
if (!__ONL_PLATFORM_NAME) {
|
||||
strncpy(mlnx_platform->onl_platform_name, "x86-64-mlnx-msn3700-all", PLATFORM_NAME_MAX_LEN);
|
||||
}
|
||||
else {
|
||||
strncpy(mlnx_platform->onl_platform_name, __ONL_PLATFORM_NAME, PLATFORM_NAME_MAX_LEN);
|
||||
}
|
||||
|
||||
if (!strcmp(mlnx_platform->onl_platform_name, "x86-64-mlnx_msn3700c-r0")) {
|
||||
mlnx_platform->led_num = CHASSIS_C_LED_COUNT;
|
||||
mlnx_platform->fan_num = CHASSIS_C_FAN_COUNT;
|
||||
mlnx_platform->thermal_num = CHASSIS_C_THERMAL_COUNT;
|
||||
} else {
|
||||
mlnx_platform->led_num = CHASSIS_LED_COUNT;
|
||||
mlnx_platform->fan_num = CHASSIS_FAN_COUNT;
|
||||
mlnx_platform->thermal_num = CHASSIS_THERMAL_COUNT;
|
||||
}
|
||||
|
||||
mlnx_platform->sfp_num = SFP_PORT_COUNT;
|
||||
mlnx_platform->psu_num = CHASSIS_PSU_COUNT;
|
||||
mlnx_platform->cpld_num = CPLD_COUNT;
|
||||
mlnx_platform->psu_fixed = false;
|
||||
mlnx_platform->fan_fixed = false;
|
||||
mlnx_platform->psu_type = PSU_TYPE_3;
|
||||
mlnx_platform->led_type = LED_TYPE_3;
|
||||
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_platform_set(const char* platform)
|
||||
{
|
||||
mlnx_platform_info_t* mlnx_platform;
|
||||
|
||||
if(!strcmp(platform, "x86-64-mlnx-msn3700-r0")) {
|
||||
__ONL_PLATFORM_NAME = "x86-64-mlnx_msn3700-r0";
|
||||
mlnx_platform = get_platform_info();
|
||||
mc_get_platform_info(mlnx_platform);
|
||||
return ONLP_STATUS_OK;
|
||||
} else if(!strcmp(platform, "x86-64-mlnx-msn3700c-r0")) {
|
||||
__ONL_PLATFORM_NAME = "x86-64-mlnx_msn3700c-r0";
|
||||
mlnx_platform = get_platform_info();
|
||||
mc_get_platform_info(mlnx_platform);
|
||||
return ONLP_STATUS_OK;
|
||||
} else if(!strcmp(platform, "x86-64-mlnx-msn3700-all")) {
|
||||
__ONL_PLATFORM_NAME = "x86-64-mlnx-msn3700-all";
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
return ONLP_STATUS_E_UNSUPPORTED;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/************************************************************
|
||||
* <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_CORE_2,
|
||||
THERMAL_CPU_CORE_3,
|
||||
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_core2",
|
||||
"cpu_core3",
|
||||
"cpu_pack",
|
||||
"asic",
|
||||
"fan_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_2), "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_3), "CPU Core 3", 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}
|
||||
}
|
||||
};
|
||||
|
||||
static char* thermal_fnames_c[] = /* must map with onlp_thermal_id */
|
||||
{
|
||||
"reserved",
|
||||
"cpu_core0",
|
||||
"cpu_core1",
|
||||
"cpu_pack",
|
||||
"asic",
|
||||
"fan_amb",
|
||||
"port_amb",
|
||||
"psu1",
|
||||
"psu2"
|
||||
};
|
||||
|
||||
/* Static values */
|
||||
static onlp_thermal_info_t tinfo_c[] = {
|
||||
{ }, /* 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();
|
||||
if(!strcmp(mlnx_platform_info->onl_platform_name, "x86-64-mlnx_msn3700c-r0")) {
|
||||
mlnx_platform_info->tinfo=tinfo_c;
|
||||
mlnx_platform_info->thermal_fnames=thermal_fnames_c;
|
||||
} else {
|
||||
mlnx_platform_info->tinfo=tinfo;
|
||||
mlnx_platform_info->thermal_fnames=thermal_fnames;
|
||||
}
|
||||
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
/* <auto.start.cdefs(X86_64_MLNX_MSN3700_CONFIG_HEADER).source> */
|
||||
#define __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(_x) #_x
|
||||
#define __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(_x) __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(_x)
|
||||
x86_64_mlnx_msn3700_config_settings_t x86_64_mlnx_msn3700_config_settings[] =
|
||||
{
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_INCLUDE_LOGGING(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_PORTING_STDLIB(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_INCLUDE_UCLI(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
{ __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) },
|
||||
#else
|
||||
{ X86_64_MLNX_MSN3700_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#undef __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_VALUE
|
||||
#undef __X86_64_MLNX_MSN3700_CONFIG_STRINGIFY_NAME
|
||||
|
||||
const char*
|
||||
x86_64_mlnx_msn3700_config_lookup(const char* setting)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; x86_64_mlnx_msn3700_config_settings[i].name; i++) {
|
||||
if(strcmp(x86_64_mlnx_msn3700_config_settings[i].name, setting)) {
|
||||
return x86_64_mlnx_msn3700_config_settings[i].value;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
x86_64_mlnx_msn3700_config_show(struct aim_pvs_s* pvs)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; x86_64_mlnx_msn3700_config_settings[i].name; i++) {
|
||||
aim_printf(pvs, "%s = %s\n", x86_64_mlnx_msn3700_config_settings[i].name, x86_64_mlnx_msn3700_config_settings[i].value);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/* <auto.end.cdefs(x86_64_mlnx_msn3700_CONFIG_HEADER).source> */
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
/* <--auto.start.enum(ALL).source> */
|
||||
/* <auto.end.enum(ALL).source> */
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* x86_64_mlnx_msn3700 Internal Header
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_MLNX_MSN3700_INT_H__
|
||||
#define __X86_64_MLNX_MSN3700_INT_H__
|
||||
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3700_INT_H__ */
|
||||
@@ -0,0 +1,18 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
#include "x86_64_mlnx_msn3700_log.h"
|
||||
/*
|
||||
* x86_64_mlnx_msn3700 log struct.
|
||||
*/
|
||||
AIM_LOG_STRUCT_DEFINE(
|
||||
X86_64_MLNX_MSN3700_CONFIG_LOG_OPTIONS_DEFAULT,
|
||||
X86_64_MLNX_MSN3700_CONFIG_LOG_BITS_DEFAULT,
|
||||
NULL, /* Custom log map */
|
||||
X86_64_MLNX_MSN3700_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_MLNX_MSN3700_LOG_H__
|
||||
#define __X86_64_MLNX_MSN3700_LOG_H__
|
||||
|
||||
#define AIM_LOG_MODULE_NAME x86_64_mlnx_msn3700
|
||||
#include <AIM/aim_log.h>
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3700_LOG_H__ */
|
||||
@@ -0,0 +1,24 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
#include "x86_64_mlnx_msn3700_log.h"
|
||||
|
||||
static int
|
||||
datatypes_init__(void)
|
||||
{
|
||||
#define x86_64_mlnx_msn3700_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL);
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700.x>
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __x86_64_mlnx_msn3700_module_init__(void)
|
||||
{
|
||||
AIM_LOG_STRUCT_REGISTER();
|
||||
datatypes_init__();
|
||||
}
|
||||
|
||||
int __onlp_platform_version__ = 1;
|
||||
@@ -0,0 +1,50 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3700/x86_64_mlnx_msn3700_config.h>
|
||||
|
||||
#if x86_64_mlnx_msn3700_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_msn3700_ucli_ucli__config__(ucli_context_t* uc)
|
||||
{
|
||||
UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_mlnx_msn3700)
|
||||
}
|
||||
|
||||
/* <auto.ucli.handlers.start> */
|
||||
/* <auto.ucli.handlers.end> */
|
||||
|
||||
static ucli_module_t
|
||||
x86_64_mlnx_msn3700_ucli_module__ =
|
||||
{
|
||||
"x86_64_mlnx_msn3700_ucli",
|
||||
NULL,
|
||||
x86_64_mlnx_msn3700_ucli_ucli_handlers__,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
ucli_node_t*
|
||||
x86_64_mlnx_msn3700_ucli_node_create(void)
|
||||
{
|
||||
ucli_node_t* n;
|
||||
ucli_module_init(&x86_64_mlnx_msn3700_ucli_module__);
|
||||
n = ucli_node_create("x86_64_mlnx_msn3700", NULL, &x86_64_mlnx_msn3700_ucli_module__);
|
||||
ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_mlnx_msn3700"));
|
||||
return n;
|
||||
}
|
||||
|
||||
#else
|
||||
void*
|
||||
x86_64_mlnx_msn3700_ucli_node_create(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Inclusive Makefile for the x86_64_mlnx_msn3700 module.
|
||||
#
|
||||
# Autogenerated 2015-12-23 23:45:56.754200
|
||||
#
|
||||
###############################################################################
|
||||
x86_64_mlnx_msn3700_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
include $(x86_64_mlnx_msn3700_BASEDIR)/module/make.mk
|
||||
include $(x86_64_mlnx_msn3700_BASEDIR)/module/auto/make.mk
|
||||
include $(x86_64_mlnx_msn3700_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-msn3700 REVISION=r0
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# platform-config for Mellanox msn3700
|
||||
#
|
||||
######################################################################
|
||||
|
||||
x86-64-mlnx-msn3700-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
|
||||
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_msn3700_r0(OnlPlatformMellanox,
|
||||
OnlPlatformPortConfig_32x100):
|
||||
PLATFORM='x86-64-mlnx-msn3700-r0'
|
||||
MODEL="MSN3700"
|
||||
SYS_OBJECT_ID=".3700.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
|
||||
3
packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3700c/.gitignore
vendored
Normal file
3
packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3700c/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*x86-64*.mk
|
||||
*x86_64*.mk
|
||||
onlpdump.mk
|
||||
@@ -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-msn3700c
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn3700c 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-msn3700c
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF mlnx_common x86_64_mlnx_msn3700 onlplib
|
||||
DEPENDMODULE_HEADERS := sff
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
SHAREDLIB := libonlp-x86-64-mlnx-msn3700c.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_msn3700 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-msn3700c REVISION=r0
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# platform-config for Mellanox 3700C
|
||||
#
|
||||
######################################################################
|
||||
|
||||
x86-64-mlnx-msn3700c-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
|
||||
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_msn3700c_r0(OnlPlatformMellanox,
|
||||
OnlPlatformPortConfig_32x40):
|
||||
PLATFORM='x86-64-mlnx-msn3700c-r0'
|
||||
MODEL="MSN3700C"
|
||||
SYS_OBJECT_ID=".3700.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