From 3a7d0a6b2f289c6862a5d87072113391055d64c1 Mon Sep 17 00:00:00 2001 From: vincent0083 Date: Thu, 30 Mar 2017 15:52:16 +0800 Subject: [PATCH 1/2] Add new platform for Delta WB2448. --- .../configs/x86_64-all/x86_64-all.config | 11 +- ...river-support-intel-igb-bcm50210-phy.patch | 96 ++++++ .../base/any/kernels/3.16-lts/patches/series | 1 + packages/platforms/delta/Makefile | 1 + .../platforms/delta/vendor-config/Makefile | 1 + .../platforms/delta/vendor-config/PKG.yml | 1 + .../src/python/delta/__init__.py | 7 + packages/platforms/delta/x86-64/Makefile | 1 + .../platforms/delta/x86-64/modules/Makefile | 1 + .../platforms/delta/x86-64/modules/PKG.yml | 1 + .../x86-64/x86-64-delta-wb2448/.gitignore | 3 + .../delta/x86-64/x86-64-delta-wb2448/Makefile | 1 + .../x86-64-delta-wb2448/modules/Makefile | 1 + .../x86-64-delta-wb2448/modules/PKG.yml | 1 + .../x86-64/x86-64-delta-wb2448/onlp/Makefile | 1 + .../x86-64/x86-64-delta-wb2448/onlp/PKG.yml | 1 + .../x86-64-delta-wb2448/onlp/builds/Makefile | 2 + .../onlp/builds/lib/Makefile | 45 +++ .../lib/libonlp-x86-64-delta-wb2448-r0.mk | 10 + .../onlp/builds/onlpdump/Makefile | 46 +++ .../onlp/builds/src/.module | 1 + .../onlp/builds/src/Makefile | 10 + .../onlp/builds/src/module/auto/make.mk | 10 + .../src/module/auto/x86_64_delta_wb2448.yml | 55 ++++ .../x86_64_delta_wb2448/x86_64_delta_wb2448.x | 16 + .../x86_64_delta_wb2448_config.h | 155 +++++++++ .../x86_64_delta_wb2448_dox.h | 26 ++ .../x86_64_delta_wb2448_porting.h | 107 ++++++ .../onlp/builds/src/module/make.mk | 10 + .../onlp/builds/src/module/src/Makefile | 12 + .../onlp/builds/src/module/src/fani.c | 154 +++++++++ .../onlp/builds/src/module/src/ledi.c | 289 ++++++++++++++++ .../onlp/builds/src/module/src/make.mk | 11 + .../onlp/builds/src/module/src/platform_lib.c | 311 ++++++++++++++++++ .../onlp/builds/src/module/src/platform_lib.h | 47 +++ .../onlp/builds/src/module/src/psui.c | 123 +++++++ .../onlp/builds/src/module/src/sfpi.c | 86 +++++ .../onlp/builds/src/module/src/sysi.c | 154 +++++++++ .../onlp/builds/src/module/src/thermali.c | 158 +++++++++ .../module/src/x86_64_delta_wb2448_config.c | 93 ++++++ .../module/src/x86_64_delta_wb2448_enums.c | 12 + .../src/module/src/x86_64_delta_wb2448_int.h | 13 + .../src/module/src/x86_64_delta_wb2448_log.c | 21 ++ .../src/module/src/x86_64_delta_wb2448_log.h | 14 + .../module/src/x86_64_delta_wb2448_module.c | 26 ++ .../src/module/src/x86_64_delta_wb2448_ucli.c | 64 ++++ .../platform-config/Makefile | 1 + .../platform-config/r0/Makefile | 1 + .../platform-config/r0/PKG.yml | 2 + .../r0/src/lib/x86-64-delta-wb2448-r0.yml | 32 ++ .../python/x86_64_delta_wb2448_r0/__init__.py | 16 + 51 files changed, 2261 insertions(+), 1 deletion(-) create mode 100644 packages/base/any/kernels/3.16-lts/patches/driver-support-intel-igb-bcm50210-phy.patch create mode 100755 packages/platforms/delta/Makefile create mode 100755 packages/platforms/delta/vendor-config/Makefile create mode 100755 packages/platforms/delta/vendor-config/PKG.yml create mode 100755 packages/platforms/delta/vendor-config/src/python/delta/__init__.py create mode 100755 packages/platforms/delta/x86-64/Makefile create mode 100755 packages/platforms/delta/x86-64/modules/Makefile create mode 100755 packages/platforms/delta/x86-64/modules/PKG.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/.gitignore create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/PKG.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/PKG.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/libonlp-x86-64-delta-wb2448-r0.mk create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/onlpdump/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/.module create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/make.mk create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448.x create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/make.mk create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/make.mk create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_enums.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/Makefile create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/PKG.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/lib/x86-64-delta-wb2448-r0.yml create mode 100755 packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py diff --git a/packages/base/any/kernels/3.16-lts/configs/x86_64-all/x86_64-all.config b/packages/base/any/kernels/3.16-lts/configs/x86_64-all/x86_64-all.config index 9a35dacb..911b4dd9 100644 --- a/packages/base/any/kernels/3.16-lts/configs/x86_64-all/x86_64-all.config +++ b/packages/base/any/kernels/3.16-lts/configs/x86_64-all/x86_64-all.config @@ -507,6 +507,7 @@ CONFIG_ACPI_BUTTON=y CONFIG_ACPI_FAN=y # CONFIG_ACPI_DOCK is not set CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_IPMI is not set CONFIG_ACPI_HOTPLUG_CPU=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set CONFIG_ACPI_THERMAL=y @@ -1823,7 +1824,13 @@ CONFIG_SERIAL_JSM=y # CONFIG_TTY_PRINTK is not set CONFIG_HVC_DRIVER=y CONFIG_VIRTIO_CONSOLE=y -# CONFIG_IPMI_HANDLER is not set +CONFIG_IPMI_HANDLER=y +# CONFIG_IPMI_PANIC_EVENT is not set +CONFIG_IPMI_DEVICE_INTERFACE=y +CONFIG_IPMI_SI=y +CONFIG_IPMI_SI_PROBE_DEFAULTS=y +CONFIG_IPMI_WATCHDOG=y +CONFIG_IPMI_POWEROFF=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_TIMERIOMEM=y CONFIG_HW_RANDOM_INTEL=y @@ -2101,6 +2108,8 @@ CONFIG_SENSORS_ADM1021=y # CONFIG_SENSORS_G762 is not set CONFIG_SENSORS_GPIO_FAN=y # CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_IBMAEM is not set +# CONFIG_SENSORS_IBMPEX is not set CONFIG_SENSORS_CORETEMP=y # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_JC42 is not set diff --git a/packages/base/any/kernels/3.16-lts/patches/driver-support-intel-igb-bcm50210-phy.patch b/packages/base/any/kernels/3.16-lts/patches/driver-support-intel-igb-bcm50210-phy.patch new file mode 100644 index 00000000..5895fd57 --- /dev/null +++ b/packages/base/any/kernels/3.16-lts/patches/driver-support-intel-igb-bcm50210-phy.patch @@ -0,0 +1,96 @@ +diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c +index d65a0b1..e070d26 100644 +--- a/drivers/net/ethernet/intel/igb/e1000_82575.c ++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c +@@ -104,6 +104,7 @@ static void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); + static void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); + static s32 e1000_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data); + static bool e1000_get_i2c_data(u32 *i2cctl); ++static s32 e1000_set_phy_mode_external_50210(struct e1000_hw *hw, struct e1000_phy_info *phy, u32 ctrl_ext); + + static const u16 e1000_82580_rxpbs_table[] = { + 36, 72, 144, 1, 2, 4, 8, 16, 35, 70, 140 }; +@@ -215,6 +216,11 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) + /* Set phy->phy_addr and phy->id. */ + ret_val = e1000_get_phy_id_82575(hw); + ++ if(phy->id == NULL) ++ { ++ ret_val = e1000_set_phy_mode_external_50210(hw, phy, ctrl_ext); ++ } ++ + /* Verify phy id and set remaining function pointers */ + switch (phy->id) { + case M88E1543_E_PHY_ID: +@@ -312,6 +318,8 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) + case BCM54616_E_PHY_ID: + phy->type = e1000_phy_bcm54616; + break; ++ case BCM50210S_E_PHY_ID: ++ break; + default: + ret_val = -E1000_ERR_PHY; + goto out; +@@ -3934,3 +3942,47 @@ s32 e1000_init_thermal_sensor_thresh_generic(struct e1000_hw *hw) + } + return E1000_SUCCESS; + } ++ ++static s32 e1000_set_phy_mode_external_50210(struct e1000_hw *hw, struct e1000_phy_info *phy, u32 ctrl_ext) ++{ ++ u32 u32Data = 0; ++ s32 ret_val = E1000_SUCCESS; ++ ++ u32Data = E1000_READ_REG(hw, E1000_MDICNFG); ++ u32Data |= 0x80000000; ++ E1000_WRITE_REG(hw, E1000_MDICNFG, u32Data); ++ ++ E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); ++ e1000_reset_mdicnfg_82580(hw); ++ ++ if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) ++ { ++ phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575; ++ phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575; ++ } ++ else ++ { ++ switch (hw->mac.type) ++ { ++ case e1000_82580: ++ case e1000_i350: ++ case e1000_i354: ++ phy->ops.read_reg = e1000_read_phy_reg_82580; ++ phy->ops.write_reg = e1000_write_phy_reg_82580; ++ break; ++ case e1000_i210: ++ case e1000_i211: ++ phy->ops.read_reg = e1000_read_phy_reg_gs40g; ++ phy->ops.write_reg = e1000_write_phy_reg_gs40g; ++ break; ++ default: ++ phy->ops.read_reg = e1000_read_phy_reg_igp; ++ phy->ops.write_reg = e1000_write_phy_reg_igp; ++ } ++ } ++ ++ /* Set phy->phy_addr and phy->id. */ ++ ret_val = e1000_get_phy_id_82575(hw); ++ ++ return ret_val; ++} +\ No newline at end of file +diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h +index c21f0be..29d8933 100644 +--- a/drivers/net/ethernet/intel/igb/e1000_defines.h ++++ b/drivers/net/ethernet/intel/igb/e1000_defines.h +@@ -1186,7 +1186,8 @@ + #define IGP04E1000_E_PHY_ID 0x02A80391 + #define BCM54616_E_PHY_ID 0x3625D10 + #define BCM5461S_PHY_ID 0x002060C0 +-#define M88_VENDOR 0x0141 ++#define M88_VENDOR 0x0141 ++#define BCM50210S_E_PHY_ID 0x600d8590 + + /* M88E1000 Specific Registers */ + #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */ diff --git a/packages/base/any/kernels/3.16-lts/patches/series b/packages/base/any/kernels/3.16-lts/patches/series index 051a395e..473d70a2 100644 --- a/packages/base/any/kernels/3.16-lts/patches/series +++ b/packages/base/any/kernels/3.16-lts/patches/series @@ -24,3 +24,4 @@ drivers-net-ethernet-broadcom-tg3-preamble-reset.patch platform-powerpc-85xx-Makefile.patch platform-powerpc-dni-7448-r0.patch platform-powerpc-quanta-lb9-r0.patch +driver-support-intel-igb-bcm50210-phy.patch diff --git a/packages/platforms/delta/Makefile b/packages/platforms/delta/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/vendor-config/Makefile b/packages/platforms/delta/vendor-config/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/vendor-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/vendor-config/PKG.yml b/packages/platforms/delta/vendor-config/PKG.yml new file mode 100755 index 00000000..ebd8124a --- /dev/null +++ b/packages/platforms/delta/vendor-config/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-vendor.yml VENDOR=delta Vendor=DELTA diff --git a/packages/platforms/delta/vendor-config/src/python/delta/__init__.py b/packages/platforms/delta/vendor-config/src/python/delta/__init__.py new file mode 100755 index 00000000..e84ef9fc --- /dev/null +++ b/packages/platforms/delta/vendor-config/src/python/delta/__init__.py @@ -0,0 +1,7 @@ +#!/usr/bin/python + +from onl.platform.base import * + +class OnlPlatformDELTA(OnlPlatformBase): + MANUFACTURER='DELTA' + PRIVATE_ENTERPRISE_NUMBER=2254 diff --git a/packages/platforms/delta/x86-64/Makefile b/packages/platforms/delta/x86-64/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/modules/Makefile b/packages/platforms/delta/x86-64/modules/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/modules/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/modules/PKG.yml b/packages/platforms/delta/x86-64/modules/PKG.yml new file mode 100755 index 00000000..ede5f7ed --- /dev/null +++ b/packages/platforms/delta/x86-64/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/no-arch-vendor-modules.yml ARCH=amd64 VENDOR=delta diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/.gitignore b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/.gitignore new file mode 100755 index 00000000..34971414 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/.gitignore @@ -0,0 +1,3 @@ +*x86*64*delta*wb2448.mk +onlpdump.mk + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/PKG.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/PKG.yml new file mode 100755 index 00000000..71b25c87 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/no-platform-modules.yml ARCH=amd64 VENDOR=delta BASENAME=x86-64-delta-wb2448 diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/PKG.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/PKG.yml new file mode 100755 index 00000000..403a0320 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-delta-wb2448 ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/Makefile new file mode 100755 index 00000000..e7437cb2 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/Makefile @@ -0,0 +1,2 @@ +FILTER=src +include $(ONL)/make/subdirs.mk diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/Makefile new file mode 100755 index 00000000..85555dcf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/Makefile @@ -0,0 +1,45 @@ +############################################################ +# +# +# Copyright 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +############################################################ +include $(ONL)/make/config.amd64.mk + +MODULE := libonlp-x86-64-delta-wb2448 +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF x86_64_delta_wb2448 onlplib +DEPENDMODULE_HEADERS := sff + +include $(BUILDER)/dependmodules.mk + +SHAREDLIB := libonlp-x86-64-delta-wb2448.so +$(SHAREDLIB)_TARGETS := $(ALL_TARGETS) +include $(BUILDER)/so.mk +.DEFAULT_GOAL := $(SHAREDLIB) + +GLOBAL_CFLAGS += -I$(onlp_BASEDIR)/module/inc +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 +GLOBAL_CFLAGS += -fPIC +GLOBAL_LINK_LIBS += -lpthread + +include $(BUILDER)/targets.mk + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/libonlp-x86-64-delta-wb2448-r0.mk b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/libonlp-x86-64-delta-wb2448-r0.mk new file mode 100755 index 00000000..be8b389e --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/lib/libonlp-x86-64-delta-wb2448-r0.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the libonlp-x86-64-delta-wb2448-r0 module. +# +# Autogenerated 2016-03-16 22:11:47.698846 +# +############################################################################### +libonlp-x86-64-delta-wb2448-r0_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/onlpdump/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/onlpdump/Makefile new file mode 100755 index 00000000..85ac6f8d --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/onlpdump/Makefile @@ -0,0 +1,46 @@ +############################################################ +# +# +# Copyright 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +# +############################################################ +include $(ONL)/make/config.amd64.mk + +.DEFAULT_GOAL := onlpdump + +MODULE := onlpdump +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF onlp x86_64_delta_wb2448 onlplib onlp_platform_defaults sff cjson cjson_util timer_wheel OS + +include $(BUILDER)/dependmodules.mk + +BINARY := onlpdump +$(BINARY)_LIBRARIES := $(LIBRARY_TARGETS) +include $(BUILDER)/bin.mk + +GLOBAL_CFLAGS += -DAIM_CONFIG_AIM_MAIN_FUNCTION=onlpdump_main +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MAIN=1 +GLOBAL_LINK_LIBS += -lpthread -lm + +include $(BUILDER)/targets.mk + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/.module b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/.module new file mode 100755 index 00000000..a6e8c356 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/.module @@ -0,0 +1 @@ +name: x86_64_delta_wb2448 diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/Makefile new file mode 100755 index 00000000..e0e3f7e4 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/Makefile @@ -0,0 +1,10 @@ +############################################################ +# +# +# +############################################################ +include $(ONL)/make/config.mk + +MODULE := x86_64_delta_wb2448 +AUTOMODULE := x86_64_delta_wb2448 +include $(BUILDER)/definemodule.mk diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/make.mk b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/make.mk new file mode 100755 index 00000000..f04f7a91 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/make.mk @@ -0,0 +1,10 @@ +############################################################################### +# +# x86_64_delta_wb2448 Autogeneration +# +############################################################################### + +x86_64_delta_wb2448_AUTO_DEFS := module/auto/x86_64_delta_wb2448.yml +x86_64_delta_wb2448_AUTO_DIRS := module/inc/x86_64_delta_wb2448 module/src +include $(BUILDER)/auto.mk + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml new file mode 100755 index 00000000..ccfd3bec --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml @@ -0,0 +1,55 @@ +############################################################################### +# +# x86_64_delta_wb2448 Autogeneration Definitions. +# +############################################################################### + +cdefs: &cdefs +- x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING: + doc: "Include or exclude logging." + default: 1 +- x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT: + doc: "Default enabled log options." + default: AIM_LOG_OPTIONS_DEFAULT +- x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT: + doc: "Default enabled log bits." + default: AIM_LOG_BITS_DEFAULT +- x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT: + doc: "Default enabled custom log bits." + default: 0 +- x86_64_delta_wb2448_CONFIG_PORTING_STDLIB: + doc: "Default all porting macros to use the C standard libraries." + default: 1 +- x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: + doc: "Include standard library headers for stdlib porting macros." + default: X86_64_delta_wb2448_CONFIG_PORTING_STDLIB +- x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI: + doc: "Include generic uCli support." + default: 0 +- x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION: + doc: "Assume chassis fan direction is the same as the PSU fan direction." + default: 0 +- x86_64_delta_wb2448_CONFIG_SFP_COUNT: + doc: "SFP port numbers." + default: 4 +- x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX: + doc: "Max fan speed." + default: 18000 + +definitions: + cdefs: + x86_64_delta_wb2448_CONFIG_HEADER: + defs: *cdefs + basename: x86_64_delta_wb2448_config + + portingmacro: + x86_64_delta_wb2448: + macros: + - malloc + - free + - memset + - memcpy + - strncpy + - vsnprintf + - snprintf + - strlen diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448.x b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448.x new file mode 100755 index 00000000..31e0ad52 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448.x @@ -0,0 +1,16 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +/* <--auto.start.xmacro(ALL).define> */ +/* */ + +/* <--auto.start.xenum(ALL).define> */ +/* */ + + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h new file mode 100755 index 00000000..67dbd3b6 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h @@ -0,0 +1,155 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_delta_wb2448 Configuration Header + * + * @addtogroup x86_64_delta_wb2448-config + * @{ + * + *****************************************************************************/ +#ifndef __x86_64_delta_wb2448_CONFIG_H__ +#define __x86_64_delta_wb2448_CONFIG_H__ + +#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG +#include +#endif +#ifdef x86_64_delta_wb2448_INCLUDE_CUSTOM_CONFIG +#include +#endif + +/* */ +#include +/** + * x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING + * + * Include or exclude logging. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING +#define x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING 1 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT + * + * Default enabled log options. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT +#define x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT +#endif + +/** + * x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT + * + * Default enabled log bits. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT +#define x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT +#endif + +/** + * x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT + * + * Default enabled custom log bits. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT +#define x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_PORTING_STDLIB + * + * Default all porting macros to use the C standard libraries. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_PORTING_STDLIB +#define x86_64_delta_wb2448_CONFIG_PORTING_STDLIB 1 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + * + * Include standard library headers for stdlib porting macros. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS +#define x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS x86_64_delta_wb2448_CONFIG_PORTING_STDLIB +#endif + +/** + * x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI + * + * Include generic uCli support. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI +#define x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI 0 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + * + * Assume chassis fan direction is the same as the PSU fan direction. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION +#define x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_SFP_COUNT + * + * SFP port numbers. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_SFP_COUNT +#define x86_64_delta_wb2448_CONFIG_SFP_COUNT 4 +#endif + +/** + * x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX + * + * Max fan speed. */ + + +#ifndef x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX +#define x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX 18000 +#endif + +/** + * All compile time options can be queried or displayed + */ + +/** Configuration settings structure. */ +typedef struct x86_64_delta_wb2448_config_settings_s { + /** name */ + const char* name; + /** value */ + const char* value; +} x86_64_delta_wb2448_config_settings_t; + +/** Configuration settings table. */ +/** x86_64_delta_wb2448_config_settings table. */ +extern x86_64_delta_wb2448_config_settings_t x86_64_delta_wb2448_config_settings[]; + +/** + * @brief Lookup a configuration setting. + * @param setting The name of the configuration option to lookup. + */ +const char* x86_64_delta_wb2448_config_lookup(const char* setting); + +/** + * @brief Show the compile-time configuration. + * @param pvs The output stream. + */ +int x86_64_delta_wb2448_config_show(struct aim_pvs_s* pvs); + +/* */ + +#include "x86_64_delta_wb2448_porting.h" + +#endif /* __x86_64_delta_wb2448_CONFIG_H__ */ +/* @} */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h new file mode 100755 index 00000000..9863573e --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h @@ -0,0 +1,26 @@ +/**************************************************************************//** + * + * x86_64_delta_wb2448 Doxygen Header + * + *****************************************************************************/ +#ifndef __x86_64_delta_wb2448_DOX_H__ +#define __x86_64_delta_wb2448_DOX_H__ + +/** + * @defgroup x86_64_delta_wb2448 x86_64_delta_wb2448 - x86_64_delta_wb2448 Description + * + +The documentation overview for this module should go here. + + * + * @{ + * + * @defgroup x86_64_delta_wb2448-x86_64_delta_wb2448 Public Interface + * @defgroup x86_64_delta_wb2448-config Compile Time Configuration + * @defgroup x86_64_delta_wb2448-porting Porting Macros + * + * @} + * + */ + +#endif /* __x86_64_delta_wb2448_DOX_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h new file mode 100755 index 00000000..a2b8983b --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h @@ -0,0 +1,107 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_delta_wb2448 Porting Macros. + * + * @addtogroup x86_64_delta_wb2448-porting + * @{ + * + *****************************************************************************/ +#ifndef __x86_64_delta_wb2448_PORTING_H__ +#define __x86_64_delta_wb2448_PORTING_H__ + + +/* */ +#if x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1 +#include +#include +#include +#include +#include +#endif + +#ifndef x86_64_delta_wb2448_MALLOC + #if defined(GLOBAL_MALLOC) + #define x86_64_delta_wb2448_MALLOC GLOBAL_MALLOC + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_MALLOC malloc + #else + #error The macro x86_64_delta_wb2448_MALLOC is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_FREE + #if defined(GLOBAL_FREE) + #define x86_64_delta_wb2448_FREE GLOBAL_FREE + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_FREE free + #else + #error The macro x86_64_delta_wb2448_FREE is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_MEMSET + #if defined(GLOBAL_MEMSET) + #define x86_64_delta_wb2448_MEMSET GLOBAL_MEMSET + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_MEMSET memset + #else + #error The macro x86_64_delta_wb2448_MEMSET is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_MEMCPY + #if defined(GLOBAL_MEMCPY) + #define x86_64_delta_wb2448_MEMCPY GLOBAL_MEMCPY + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_MEMCPY memcpy + #else + #error The macro x86_64_delta_wb2448_MEMCPY is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_STRNCPY + #if defined(GLOBAL_STRNCPY) + #define x86_64_delta_wb2448_STRNCPY GLOBAL_STRNCPY + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_STRNCPY strncpy + #else + #error The macro x86_64_delta_wb2448_STRNCPY is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_VSNPRINTF + #if defined(GLOBAL_VSNPRINTF) + #define x86_64_delta_wb2448_VSNPRINTF GLOBAL_VSNPRINTF + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_VSNPRINTF vsnprintf + #else + #error The macro x86_64_delta_wb2448_VSNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_SNPRINTF + #if defined(GLOBAL_SNPRINTF) + #define x86_64_delta_wb2448_SNPRINTF GLOBAL_SNPRINTF + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_SNPRINTF snprintf + #else + #error The macro x86_64_delta_wb2448_SNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef x86_64_delta_wb2448_STRLEN + #if defined(GLOBAL_STRLEN) + #define x86_64_delta_wb2448_STRLEN GLOBAL_STRLEN + #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 + #define x86_64_delta_wb2448_STRLEN strlen + #else + #error The macro x86_64_delta_wb2448_STRLEN is required but cannot be defined. + #endif +#endif + +/* */ + + +#endif /* __x86_64_delta_wb2448_PORTING_H__ */ +/* @} */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/make.mk b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/make.mk new file mode 100755 index 00000000..e202e01c --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/make.mk @@ -0,0 +1,10 @@ +############################################################################### +# +# +# +############################################################################### +THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +x86_64_delta_wb2448_INCLUDES := -I $(THIS_DIR)inc +x86_64_delta_wb2448_INTERNAL_INCLUDES := -I $(THIS_DIR)src +x86_64_delta_wb2448_DEPENDMODULE_ENTRIES := init:x86_64_delta_wb2448 ucli:x86_64_delta_wb2448 + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/Makefile new file mode 100755 index 00000000..b3b5c0f0 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/Makefile @@ -0,0 +1,12 @@ +############################################################################### +# +# Local source generation targets. +# +############################################################################### + + +include ../../../../init.mk + +ucli: + $(SUBMODULE_BIGCODE)/tools/uclihandlers.py x86_64_delta_wb2448_ucli.c + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c new file mode 100755 index 00000000..4f58463e --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c @@ -0,0 +1,154 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * Fan Platform Implementation Defaults. + * + ***********************************************************/ +#include +#include "x86_64_delta_wb2448_int.h" + +#include +#include +#include +#include +#include + +#include "platform_lib.h" + +#define VALIDATE(_id) \ + do \ + { \ + if(!ONLP_OID_IS_FAN(_id)) \ + { \ + return ONLP_STATUS_E_INVALID; \ + } \ + } while(0) + +enum onlp_fan_id +{ + FAN_RESERVED = 0, + SYSTEM_FAN_1, + SYSTEM_FAN_2, +}; + +/* Static values */ +static onlp_fan_info_t linfo[] = +{ + { }, /* Not used */ + { + { ONLP_FAN_ID_CREATE(SYSTEM_FAN_1), "Chassis System FAN 1", 0}, + ONLP_FAN_STATUS_PRESENT, + ONLP_FAN_CAPS_SET_PERCENTAGE | ONLP_FAN_CAPS_GET_RPM | ONLP_FAN_CAPS_GET_PERCENTAGE, 0, 0, ONLP_FAN_MODE_INVALID, + }, + { + { ONLP_FAN_ID_CREATE(SYSTEM_FAN_2), "Chassis System FAN 2", 0}, + ONLP_FAN_STATUS_PRESENT, + ONLP_FAN_CAPS_SET_PERCENTAGE | ONLP_FAN_CAPS_GET_RPM | ONLP_FAN_CAPS_GET_PERCENTAGE, 0, 0, ONLP_FAN_MODE_INVALID, + }, +}; + +/* + * This function will be called prior to all of onlp_fani_* functions. + */ +int +onlp_fani_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_fani_info_get(onlp_oid_t id, onlp_fan_info_t* info) +{ + INT4 rv = ONLP_STATUS_OK; + INT4 local_id = 0; + UINT4 u4Data = 0; + + VALIDATE(id); + + local_id = ONLP_OID_ID_GET(id); + + *info = linfo[ONLP_OID_ID_GET(id)]; + + switch(local_id) + { + case SYSTEM_FAN_1: + rv = ifnBmcFanSpeedGet("FanPWM_1", &u4Data); + break; + + case SYSTEM_FAN_2: + rv = ifnBmcFanSpeedGet("FanPWM_2", &u4Data); + break; + + default: + printf("Invalid Fan ID!!\n"); + rv = ONLP_STATUS_E_PARAM; + } + + if(rv == ONLP_STATUS_OK) + { + info->rpm = u4Data; + info->percentage = (info->rpm * 100) / x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX; + } + + return rv; +} + +int +onlp_fani_percentage_set(onlp_oid_t id, int p) +{ + INT4 local_id; + + VALIDATE(id); + + local_id = ONLP_OID_ID_GET(id); + + if ( p < 0 || p > 100) + { + printf("Invalid fan percentage !!"); + return ONLP_STATUS_E_PARAM; + } + + if (ifnBmcFanSpeedSet(local_id - 1, p) != ONLP_STATUS_OK) + { + return ONLP_STATUS_E_INTERNAL; + } + + return ONLP_STATUS_OK; +} + +int +onlp_fani_rpm_set(onlp_oid_t id, int rpm) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} + +int +onlp_fani_mode_set(onlp_oid_t id, onlp_fan_mode_t mode) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} + +int +onlp_fani_ioctl(onlp_oid_t fid, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c new file mode 100755 index 00000000..fb071133 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c @@ -0,0 +1,289 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + ***********************************************************/ +#include +#include "x86_64_delta_wb2448_int.h" + +#include +#include +#include +#include +#include + +#include "platform_lib.h" + +#define VALIDATE(_id) \ + do \ + { \ + if(!ONLP_OID_IS_LED(_id)) \ + { \ + return ONLP_STATUS_E_INVALID; \ + } \ + } while(0) + +#define I2C_BUS 0x04 +#define CPLD_ADDR 0x28 +#define SYS_LED_REGISTER 0x09 +#define TEMP_LED_REGISTER 0x09 +#define FAN_LED_REGISTER 0x09 +#define LED_ADDR_LEN 0x01 +#define LED_DATA_LEN 0x01 + +/* LED related data + */ +enum onlp_led_id +{ + LED_RESERVED = 0, + LED_SYSTEM, + LED_FAN, + LED_TEMP +}; + +enum led_light_mode +{ + LED_MODE_OFF = 0, + LED_MODE_GREEN, + LED_MODE_RED, + LED_MODE_AMBER, + LED_MODE_BLUE, + LED_MODE_GREEN_BLINK =0 , + LED_MODE_AMBER_BLINK, + LED_MODE_RED_BLINK = 3, + LED_MODE_BLUE_BLINK, + LED_MODE_AUTO, + LED_MODE_UNKNOWN +}; + +typedef struct led_light_mode_map +{ + enum onlp_led_id id; + enum led_light_mode driver_led_mode; + enum onlp_led_mode_e onlp_led_mode; +} led_light_mode_map_t; + +led_light_mode_map_t led_map[] = +{ + {LED_SYSTEM, LED_MODE_GREEN_BLINK, ONLP_LED_MODE_GREEN_BLINKING}, + {LED_SYSTEM, LED_MODE_GREEN, ONLP_LED_MODE_GREEN}, + {LED_SYSTEM, LED_MODE_RED, ONLP_LED_MODE_RED}, + {LED_SYSTEM, LED_MODE_RED_BLINK, ONLP_LED_MODE_RED_BLINKING}, + {LED_FAN, LED_MODE_GREEN, ONLP_LED_MODE_GREEN}, + {LED_FAN, LED_MODE_RED, ONLP_LED_MODE_RED}, + {LED_TEMP, LED_MODE_OFF, ONLP_LED_MODE_OFF}, + {LED_TEMP, LED_MODE_GREEN, ONLP_LED_MODE_GREEN}, + {LED_TEMP, LED_MODE_RED, ONLP_LED_MODE_RED} +}; + +/* + * Get the information for the given LED OID. + */ + +static onlp_led_info_t linfo[] = +{ + { }, + { + { ONLP_LED_ID_CREATE(LED_SYSTEM), "Chassis LED 1 (SYSTEM)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_GREEN_BLINKING | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN), "Chassis LED 2 (FAN)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_RED, + }, + { + { ONLP_LED_ID_CREATE(LED_TEMP), "Chassis LED 3 (TEMP)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_RED, + }, +}; + +static int driver_to_onlp_led_mode(enum onlp_led_id id, enum led_light_mode driver_led_mode) +{ + int i, nsize = sizeof(led_map)/sizeof(led_map[0]); + + for (i = 0; i < nsize; i++) + { + if (id == led_map[i].id && driver_led_mode == led_map[i].driver_led_mode) + { + return led_map[i].onlp_led_mode; + } + } + + return 0; +} + +static int onlp_to_driver_led_mode(enum onlp_led_id id, onlp_led_mode_t onlp_led_mode) +{ + int i, nsize = sizeof(led_map)/sizeof(led_map[0]); + + for(i = 0; i < nsize; i++) + { + if (id == led_map[i].id && onlp_led_mode == led_map[i].onlp_led_mode) + { + return led_map[i].driver_led_mode; + } + } + + return 0; +} + +int +onlp_ledi_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) +{ + INT4 rv = ONLP_STATUS_OK; + INT4 local_id = 0; + UINT4 u4LedMode = 0; + + VALIDATE(id); + + local_id = ONLP_OID_ID_GET(id); + + *info = linfo[ONLP_OID_ID_GET(id)]; + + /* Get LED mode */ + switch(local_id) + { + case LED_SYSTEM: + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, SYS_LED_REGISTER, LED_ADDR_LEN, &u4LedMode, LED_DATA_LEN); + u4LedMode = u4LedMode >> 6; + break; + + case LED_FAN: + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, TEMP_LED_REGISTER, LED_ADDR_LEN, &u4LedMode, LED_DATA_LEN); + u4LedMode = (u4LedMode >> 2) & 0x03; + break; + + case LED_TEMP: + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, FAN_LED_REGISTER, LED_ADDR_LEN, &u4LedMode, LED_DATA_LEN); + u4LedMode = (u4LedMode >> 4) & 0x03; + break; + + default: + printf("Invalid LED ID!!\n"); + rv = ONLP_STATUS_E_PARAM; + } + + if( rv == ONLP_STATUS_OK) + { + info->mode = driver_to_onlp_led_mode(local_id, u4LedMode); + + /* Set the on/off status */ + if (info->mode != ONLP_LED_MODE_OFF) + { + info->status |= ONLP_LED_STATUS_ON; + } + } + + return rv; +} + +/* + * @brief Turn an LED on or off. + * @param id The LED OID + * @param on_or_off Led on (1) or LED off (0) + * @param Relevant if the LED has the ON_OFF capability. + * @note For the purposes of this function the + * interpretation of "on" for multi-mode or multi-color LEDs + * is up to the platform implementation. + */ +int +onlp_ledi_set(onlp_oid_t id, int on_or_off) +{ + VALIDATE(id); + + if (!on_or_off) + { + return onlp_ledi_mode_set(id, ONLP_LED_MODE_OFF); + } + + return ONLP_STATUS_E_UNSUPPORTED; +} + +int +onlp_ledi_ioctl(onlp_oid_t id, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} + +/* + * This function puts the LED into the given mode. It is a more functional + * interface for multimode LEDs. + * + * Only modes reported in the LED's capabilities will be attempted. + */ +int +onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) +{ + INT4 rv = ONLP_STATUS_OK; + INT4 local_id = 0; + UINT4 u4Addr = 0; + UINT4 u4NewLedMode = 0; + UINT4 u4OldLedMode = 0; + onlp_led_mode_t driver_led_mode = 0; + + VALIDATE(id); + + local_id = ONLP_OID_ID_GET(id); + driver_led_mode = onlp_to_driver_led_mode(local_id, mode); + + switch(local_id) + { + case LED_SYSTEM: + u4Addr = SYS_LED_REGISTER; + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, u4Addr, LED_ADDR_LEN, &u4OldLedMode, LED_DATA_LEN); + u4NewLedMode = ( (u4OldLedMode & 0x3C) | ((driver_led_mode << 6) & 0xC0) ); + break; + + case LED_FAN: + u4Addr = FAN_LED_REGISTER; + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, u4Addr, LED_ADDR_LEN, &u4OldLedMode, LED_DATA_LEN); + u4NewLedMode = ( (u4OldLedMode & 0xF0) | ((driver_led_mode << 2) & 0x0C) ); + break; + + case LED_TEMP: + u4Addr = TEMP_LED_REGISTER; + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, u4Addr, LED_ADDR_LEN, &u4OldLedMode, LED_DATA_LEN); + u4NewLedMode = ( (u4OldLedMode & 0xCC) | ((driver_led_mode << 4) & 0x30) ); + break; + + default: + rv = ONLP_STATUS_E_PARAM; + printf("Invalid LED ID!!\n"); + } + + if(rv == ONLP_STATUS_OK) + { + rv = ifnOS_LINUX_BmcI2CSet(I2C_BUS, CPLD_ADDR, u4Addr, LED_ADDR_LEN, u4NewLedMode, LED_DATA_LEN); + } + + return rv; +} + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/make.mk b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/make.mk new file mode 100755 index 00000000..31060231 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/make.mk @@ -0,0 +1,11 @@ +############################################################################### +# +# +# +############################################################################### + + +LIBRARY := x86_64_delta_wb2448 +$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST))) +#$(LIBRARY)_LAST := 1 +include $(BUILDER)/lib.mk diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c new file mode 100755 index 00000000..f7b70a43 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c @@ -0,0 +1,311 @@ +/************************************************************ + * + * + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "platform_lib.h" + +/**************************************************************************** + * FUNCTION : ifnOS_LINUX_BmcI2CGet + * DESCRIPTION : To read data through BMC I2C + * INPUT : u1Bus + * u1Dev + * u4Addr + * u1AddrLen + * u1DataLen + * OUTPUT : pu4RetData + * RETURN : ONLP_STATUS_OK + ****************************************************************************/ +INT4 ifnOS_LINUX_BmcI2CGet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrLen, UINT4 *pu4RetData, UINT1 u1DataLen) +{ + INT4 i = 0; + INT4 i4Cnt = 1; + INT4 i4Ret = ONLP_STATUS_OK; + UINT4 u4Data = 0; + FILE *pFd = NULL; + UINT1 au1Temp[2] = {0}; + INT1 ai1Cmd [OS_MAX_MSG_SIZE] = {0}; + INT1 ai1Data[OS_MAX_MSG_SIZE] = {0}; + + sprintf(ai1Cmd, "ipmitool raw 0x38 0x2 %d %d %d %d", u1Bus, u1Dev, u4Addr, u1DataLen); + + pFd = popen(ai1Cmd, "r"); + + if(pFd != NULL) + { + if (fgets(ai1Data, OS_MAX_MSG_SIZE, pFd) != NULL) + { + while (i < u1DataLen) + { + au1Temp[0] = ai1Data[i4Cnt++]; + au1Temp[1] = ai1Data[i4Cnt++]; + + i4Cnt++; + + u4Data <<= (i*8); + u4Data += (UINT1)MMI_XTOI(au1Temp); + + i++; + } + + *pu4RetData = u4Data; + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + } + + pclose(pFd); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + } + + return i4Ret; +} + +/**************************************************************************** + * FUNCTION : ifnOS_LINUX_BmcI2CSet + * DESCRIPTION : To write data through BMC I2C + * INPUT : u1Bus + * u1Dev + * u4Addr + * u1AddrLen + * u4Data + * u1DataLen + * OUTPUT : N/A + * RETURN : ONLP_STATUS_OK + ****************************************************************************/ +INT4 ifnOS_LINUX_BmcI2CSet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrLen, UINT4 u4Data, UINT1 u1DataLen) +{ + INT4 i4Ret = ONLP_STATUS_OK; + FILE *pFd = NULL; + INT1 ai1Cmd[OS_MAX_MSG_SIZE] = {0}; + + switch (u1DataLen) + { + case 1: + sprintf(ai1Cmd, "ipmitool raw 0x38 0x3 %d %d %d %d", u1Bus, u1Dev, u4Addr, u4Data); + break; + case 2: + sprintf(ai1Cmd, "ipmitool raw 0x38 0x4 %d %d %d %d %d", u1Bus, u1Dev, u4Addr, ((u4Data&0xFF00)>>8), (u4Data&0xFF)); + break; + case 4: + sprintf(ai1Cmd, "ipmitool raw 0x38 0x5 %d %d %d %d %d %d %d", u1Bus, u1Dev, u4Addr, ((u4Data&0xFF000000)>>24), ((u4Data&0xFF0000)>>16), ((u4Data&0xFF00)>>8), (u4Data&0xFF)); + break; + default: + printf("ERR: Unsupported data length: %d", u1DataLen); + } + + pFd = popen(ai1Cmd, "r"); + + if (pFd != NULL) + { + pclose(pFd); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + } + + return i4Ret; +} + +/**************************************************************************** + * FUNCTION : ifnOS_LINUX_BmcI2CProbe + * DESCRIPTION : To probe device through BMC I2C + * INPUT : u1Bus + * u1Dev + * OUTPUT : + * RETURN : ONLP_STATUS_OK + ****************************************************************************/ +INT4 ifnOS_LINUX_BmcI2CProbe(UINT1 u1Bus, UINT1 u1Dev) +{ + INT4 i4Ret = ONLP_STATUS_OK; + INT4 i4Cnt = 1; + UINT4 u4Data = 0; + UINT1 au1Temp[2] = {0}; + INT1 ai1Cmd [OS_MAX_MSG_SIZE] = {0}; + INT1 ai1Data[OS_MAX_MSG_SIZE] = {0}; + FILE *pFd = NULL; + + sprintf(ai1Cmd, "ipmitool raw 0x38 0x1 %d %d", u1Bus, u1Dev); + + pFd = popen(ai1Cmd, "r"); + + if(pFd != NULL) + { + if (fgets(ai1Data, OS_MAX_MSG_SIZE, pFd) != NULL) + { + au1Temp[0] = ai1Data[i4Cnt++]; + au1Temp[1] = ai1Data[i4Cnt++]; + + u4Data += (UINT1)MMI_XTOI(au1Temp); + + if (u4Data != 0x00) + printf("Probe failed (ret: %d)", i4Ret); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + } + + pclose(pFd); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + } + + return i4Ret; +} + +/**************************************************************************** + * FUNCTION : ifnBmcFanSpeedGet + * DESCRIPTION : To Get Fan Speed from Ipmitool + * INPUT : pi1FanName + * pu4RetData + * OUTPUT : + * RETURN : ONLP_STATUS_OK + ****************************************************************************/ +INT4 ifnBmcFanSpeedGet(INT1 *pi1FanName, UINT4 *pu4RetData) +{ + INT4 i4Ret = ONLP_STATUS_OK; + UINT4 u4Data = 0; + INT1 ai1Cmd [OS_MAX_MSG_SIZE] = {0}; + INT1 au1Data[OS_MAX_MSG_SIZE] = {0}; + INT1 *pui1Temp = NULL; + FILE *pFd = NULL; + + sprintf(ai1Cmd, "ipmitool sdr | grep %s", pi1FanName); + + pFd = popen(ai1Cmd, "r"); + + if(pFd != NULL) + { + if (fgets(au1Data, OS_MAX_MSG_SIZE, pFd) != NULL) + { + pui1Temp = strchr(au1Data, '|'); + + do + { + u4Data += strtol(pui1Temp, &pui1Temp, 10); + }while (*pui1Temp++); + + *pu4RetData = u4Data; + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + } + + pclose(pFd); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + } + + return i4Ret; +} + +/**************************************************************************** + * FUNCTION : ifnBmcFanSpeedSet + * DESCRIPTION : To Set Fan Speed from Ipmitool + * INPUT : u4FanNumber + * u4Percentage + * OUTPUT : + * RETURN : ONLP_STATUS_OK + ****************************************************************************/ +INT4 ifnBmcFanSpeedSet(UINT4 u4FanNumber, UINT4 u4Percentage) +{ + INT1 ai1Cmd[OS_MAX_MSG_SIZE] = {0}; + INT4 i4Ret = ONLP_STATUS_OK; + FILE *pFd = NULL; + + sprintf(ai1Cmd, "ipmitool raw 0x38 0xB %d %d", u4FanNumber, u4Percentage); + + pFd = popen(ai1Cmd, "r"); + + if (pFd != NULL) + { + pclose(pFd); + } + else + { + i4Ret = ONLP_STATUS_E_INTERNAL; + printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + } + + return i4Ret; +} + +UINT4 MMI_XTOI (const UINT1* str) +{ + INT4 digit = 0; + UINT4 x = 0; + + if ((*str == '0') && (*(str+1) == 'x')) str += 2; + + while (*str) + { + if ((*str >= '0') && (*str <= '9')) + { + digit = *str - '0'; + } + else if ((*str >= 'A') && (*str <= 'F')) + { + digit = 10 + *str - 'A'; + } + else if ((*str >= 'a') && (*str <= 'f')) + { + digit = 10 + *str - 'a'; + } + else + { + break; + } + + x *= 16; + x += digit; + str++; + } + + return x; +} diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.h new file mode 100755 index 00000000..d233ac09 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.h @@ -0,0 +1,47 @@ +/************************************************************ + * + * + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#ifndef __PLATFORM_LIB_H__ +#define __PLATFORM_LIB_H__ + +#include "x86_64_delta_wb2448_log.h" + +typedef unsigned int UINT4; +typedef unsigned short UINT2; +typedef unsigned char UINT1; +typedef int INT4; +typedef short INT2; +typedef char INT1; + +#define OS_MAX_MSG_SIZE 100 + +INT4 ifnOS_LINUX_BmcI2CGet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrLen, UINT4 *pu4RetData, UINT1 u1DataLen); +INT4 ifnOS_LINUX_BmcI2CSet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrLen, UINT4 u4Data, UINT1 u1DataLen); +INT4 ifnOS_LINUX_BmcI2CProbe(UINT1 u1Bus, UINT1 u1Dev); +INT4 ifnBmcFanSpeedGet(INT1 *pi1FanName, UINT4 *pu4RetData); +INT4 ifnBmcFanSpeedSet(UINT4 u4FanNumber, UINT4 u4Percentage); +UINT4 MMI_XTOI (const UINT1* str); + +#endif /* __PLATFORM_LIB_H__ */ + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c new file mode 100755 index 00000000..fc18afeb --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c @@ -0,0 +1,123 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#include +#include "x86_64_delta_wb2448_int.h" + +#include +#include +#include +#include +#include + +#include "platform_lib.h" + +#define VALIDATE(_id) \ + do \ + { \ + if(!ONLP_OID_IS_PSU(_id)) \ + { \ + return ONLP_STATUS_E_INVALID; \ + } \ + } while(0) + +#define I2C_BUS 0x04 +#define CPLD_ADDR 0x28 +#define PSU_PRESENT_REGISTER 0x04 +#define PSU_STATUS_REGISTER 0x05 +#define PSU_ADDR_LEN 1 +#define PSU_DATA_LEN 1 +#define PSU_STATUS_ALL_GOOD 0xbf +#define PSU_STATUS_PRESENT 0x30 +#define PSU_ID 1 + +/* + * Get all information about the given PSU oid. + */ +static onlp_psu_info_t pinfo[] = +{ + { }, /* Not used */ + { + { ONLP_PSU_ID_CREATE(PSU_ID), "PSU", 0 }, + } +}; + +int +onlp_psui_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info) +{ + INT4 rv = ONLP_STATUS_OK; + UINT4 u4PSUStatus = 0; + + VALIDATE(id); + + *info = pinfo[ONLP_OID_ID_GET(id)]; + + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, PSU_PRESENT_REGISTER, PSU_ADDR_LEN, &u4PSUStatus, PSU_DATA_LEN); + + if(rv == ONLP_STATUS_OK) + { + if (u4PSUStatus != PSU_STATUS_PRESENT) + { + info->status &= ~ONLP_PSU_STATUS_PRESENT; + return ONLP_STATUS_OK; + } + } + else + { + printf("Unable to read PSU present status: %d\r\n", rv); + } + + info->status |= ONLP_PSU_STATUS_PRESENT; + + u4PSUStatus = 0; + + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, PSU_STATUS_REGISTER, PSU_ADDR_LEN, &u4PSUStatus, PSU_DATA_LEN); + + if(rv == ONLP_STATUS_OK) + { + if (u4PSUStatus != PSU_STATUS_ALL_GOOD) + { + info->status |= ONLP_PSU_STATUS_FAILED; + } + } + else + { + printf("Unable to read PSU failed/good status: %d\r\n", rv); + } + + return rv; +} + +int +onlp_psui_ioctl(onlp_oid_t pid, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c new file mode 100755 index 00000000..bdc1d475 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c @@ -0,0 +1,86 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + ***********************************************************/ +#include +#include +#include "x86_64_delta_wb2448_log.h" + +#define SFP_PORT_BASE 49 + +static int sfp_count__ = x86_64_delta_wb2448_CONFIG_SFP_COUNT; + +int +onlp_sfpi_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_sfpi_bitmap_get(onlp_sfp_bitmap_t* bmap) +{ + int p; + + for(p = 0; p < sfp_count__; p++) + { + AIM_BITMAP_SET(bmap, p + SFP_PORT_BASE); + } + + return ONLP_STATUS_OK; +} + +int +onlp_sfpi_is_present(int port) +{ + return 0; +} + +int +onlp_sfpi_presence_bitmap_get(onlp_sfp_bitmap_t* dst) +{ + AIM_BITMAP_CLR_ALL(dst); + return ONLP_STATUS_OK; +} + +int +onlp_sfpi_rx_los_bitmap_get(onlp_sfp_bitmap_t* dst) +{ + return ONLP_STATUS_OK; +} + +/* + * This function reads the SFPs idrom and returns in + * in the data buffer provided. + */ +int +onlp_sfpi_eeprom_read(int port, uint8_t data[256]) +{ + return ONLP_STATUS_E_MISSING; +} + +int +onlp_sfpi_ioctl(int port, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c new file mode 100755 index 00000000..ac3a0795 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c @@ -0,0 +1,154 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#include +#include +#include + +#include "x86_64_delta_wb2448_log.h" +#include "platform_lib.h" + +#define IDPROM_PATH "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom" + +#define NUM_OF_THERMAL_ON_MAIN_BROAD 5 +#define NUM_OF_LED_ON_MAIN_BROAD 3 +#define NUM_OF_PSU_ON_MAIN_BROAD 1 +#define NUM_OF_FAN_ON_MAIN_BROAD 2 + +#define I2C_BUS 0x04 +#define CPLD_ADDR 0x28 +#define CPLD_VERSION_REGISTER 0x08 +#define CPLD_VERSION_ADDR_LEN 0x01 +#define CPLD_VERSION_DATA_LEN 0x01 +#define CPLD_VERSION_OFFSET 5 + +const char* +onlp_sysi_platform_get(void) +{ + return "x86-64-delta-wb2448-r0"; +} + +int +onlp_sysi_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_sysi_onie_data_get(uint8_t** data, int* size) +{ + uint8_t* rdata = aim_zmalloc(256); + + if(onlp_file_read(rdata, 256, size, IDPROM_PATH) == ONLP_STATUS_OK) + { + if(*size == 256) + { + *data = rdata; + return ONLP_STATUS_OK; + } + } + + aim_free(rdata); + *size = 0; + + return ONLP_STATUS_E_INTERNAL; +} + +int +onlp_sysi_platform_info_get(onlp_platform_info_t* pi) +{ + INT4 rv = ONLP_STATUS_OK; + UINT4 u4Data = 0; + + rv = ifnOS_LINUX_BmcI2CGet(I2C_BUS, CPLD_ADDR, CPLD_VERSION_REGISTER, CPLD_VERSION_ADDR_LEN, &u4Data, CPLD_VERSION_DATA_LEN); + + if(rv == ONLP_STATUS_OK) + { + u4Data = u4Data >> CPLD_VERSION_OFFSET; + + pi->cpld_versions = aim_fstrdup("%d", u4Data); + } + + return rv; +} + +void +onlp_sysi_platform_info_free(onlp_platform_info_t* pi) +{ + aim_free(pi->cpld_versions); +} + +void +onlp_sysi_onie_data_free(uint8_t* data) +{ + /* + * We returned a static array in onlp_sysi_onie_data_get() + * so no free operation is required. + */ +} + + +int +onlp_sysi_oids_get(onlp_oid_t* table, int max) +{ + int i = 0; + onlp_oid_t* e = table; + + memset(table, 0, max*sizeof(onlp_oid_t)); + + /* 5 Thermal sensors on the chassis */ + for (i = 1; i <= NUM_OF_THERMAL_ON_MAIN_BROAD; i++) + { + *e++ = ONLP_THERMAL_ID_CREATE(i); + } + + /* 3 LEDs on the chassis */ + for (i = 1; i <= NUM_OF_LED_ON_MAIN_BROAD; i++) + { + *e++ = ONLP_LED_ID_CREATE(i); + } + + /* 1 PSUs on the chassis */ + for (i = 1; i <= NUM_OF_PSU_ON_MAIN_BROAD; i++) + { + *e++ = ONLP_PSU_ID_CREATE(i); + } + + /* 2 Fans on the chassis */ + for (i = 1; i <= NUM_OF_FAN_ON_MAIN_BROAD; i++) + { + *e++ = ONLP_FAN_ID_CREATE(i); + } + + return 0; +} + +int +onlp_sysi_ioctl(int code, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} + + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c new file mode 100755 index 00000000..17eab59e --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c @@ -0,0 +1,158 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * Copyright 2017 Delta Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * Thermal Sensor Platform Implementation. + * + ***********************************************************/ +#include +#include "x86_64_delta_wb2448_log.h" + +#include +#include +#include +#include +#include +#include + +#include "platform_lib.h" + +#define VALIDATE(_id) \ + do \ + { \ + if(!ONLP_OID_IS_THERMAL(_id)) \ + { \ + return ONLP_STATUS_E_INVALID; \ + } \ + } while(0) + +#define THERMAL_CPU_I2C_BUS 0x00 +#define THERMAL_12_I2C_BUS 0x01 +#define THERMAL_34_I2C_BUS 0x04 +#define THERMAL_CPU_ADDR 0x4D +#define THERMAL_1_ADDR 0x4B +#define THERMAL_2_ADDR 0x4C +#define THERMAL_3_ADDR 0x49 +#define THERMAL_4_ADDR 0x4A +#define THERMAL_REGISTER 0x00 +#define THERMAL_ADDR_LEN 0x01 +#define THERMAL_DATA_LEN 0x01 + +enum onlp_thermal_id +{ + THERMAL_RESERVED = 0, + THERMAL_CPU_CORE, + THERMAL_1_ON_MAIN_BROAD, + THERMAL_2_ON_MAIN_BROAD, + THERMAL_3_ON_MAIN_BROAD, + THERMAL_4_ON_MAIN_BROAD, +}; + +/* Static values */ +static onlp_thermal_info_t linfo[] = { + { }, /* Not used */ + { + { ONLP_THERMAL_ID_CREATE(THERMAL_CPU_CORE), "CPU Core", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { + { ONLP_THERMAL_ID_CREATE(THERMAL_1_ON_MAIN_BROAD), "Chassis Thermal Sensor 1", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { + { ONLP_THERMAL_ID_CREATE(THERMAL_2_ON_MAIN_BROAD), "Chassis Thermal Sensor 2", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { + { ONLP_THERMAL_ID_CREATE(THERMAL_3_ON_MAIN_BROAD), "Chassis Thermal Sensor 3", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { + { ONLP_THERMAL_ID_CREATE(THERMAL_4_ON_MAIN_BROAD), "Chassis Thermal Sensor 4", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS + }, +}; + +int +onlp_thermali_init(void) +{ + return ONLP_STATUS_OK; +} + +int +onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info) +{ + INT4 rv = ONLP_STATUS_OK; + INT4 local_id = 0; + INT4 temp_base = 1000; + UINT4 u4Data = 0; + + VALIDATE(id); + + local_id = ONLP_OID_ID_GET(id); + + *info = linfo[ONLP_OID_ID_GET(id)]; + + switch(local_id) + { + case THERMAL_CPU_CORE: + rv = ifnOS_LINUX_BmcI2CGet(THERMAL_CPU_I2C_BUS, THERMAL_CPU_ADDR, THERMAL_REGISTER, THERMAL_ADDR_LEN, &u4Data, THERMAL_DATA_LEN); + break; + + case THERMAL_1_ON_MAIN_BROAD: + rv = ifnOS_LINUX_BmcI2CGet(THERMAL_12_I2C_BUS, THERMAL_1_ADDR, THERMAL_REGISTER, THERMAL_ADDR_LEN, &u4Data, THERMAL_DATA_LEN); + break; + + case THERMAL_2_ON_MAIN_BROAD: + rv = ifnOS_LINUX_BmcI2CGet(THERMAL_12_I2C_BUS, THERMAL_2_ADDR, THERMAL_REGISTER, THERMAL_ADDR_LEN, &u4Data, THERMAL_DATA_LEN); + break; + + case THERMAL_3_ON_MAIN_BROAD: + rv = ifnOS_LINUX_BmcI2CGet(THERMAL_34_I2C_BUS, THERMAL_3_ADDR, THERMAL_REGISTER, THERMAL_ADDR_LEN, &u4Data, THERMAL_DATA_LEN); + break; + + case THERMAL_4_ON_MAIN_BROAD: + rv = ifnOS_LINUX_BmcI2CGet(THERMAL_34_I2C_BUS, THERMAL_4_ADDR, THERMAL_REGISTER, THERMAL_ADDR_LEN, &u4Data, THERMAL_DATA_LEN); + break; + + default: + printf("Invalid Thermal ID!!\n"); + return ONLP_STATUS_E_PARAM; + } + + if(rv == ONLP_STATUS_OK) + { + info->mcelsius = u4Data * temp_base; + } + + return rv; +} + +int +onlp_thermali_ioctl(int id, va_list vargs) +{ + return ONLP_STATUS_E_UNSUPPORTED; +} \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c new file mode 100755 index 00000000..673e501f --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c @@ -0,0 +1,93 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +/* */ +#define __x86_64_delta_wb2448_config_STRINGIFY_NAME(_x) #_x +#define __x86_64_delta_wb2448_config_STRINGIFY_VALUE(_x) __x86_64_delta_wb2448_config_STRINGIFY_NAME(_x) +x86_64_delta_wb2448_config_settings_t x86_64_delta_wb2448_config_settings[] = +{ +#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING) }, +#else +{ x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT) }, +#else +{ x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT) }, +#else +{ x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, +#else +{ x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_PORTING_STDLIB + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_PORTING_STDLIB), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_PORTING_STDLIB) }, +#else +{ x86_64_delta_wb2448_CONFIG_PORTING_STDLIB(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, +#else +{ x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI) }, +#else +{ x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) }, +#else +{ x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_SFP_COUNT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_SFP_COUNT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_SFP_COUNT) }, +#else +{ x86_64_delta_wb2448_CONFIG_SFP_COUNT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX) }, +#else +{ x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +#endif + { NULL, NULL } +}; +#undef __x86_64_delta_wb2448_config_STRINGIFY_VALUE +#undef __x86_64_delta_wb2448_config_STRINGIFY_NAME + +const char* +x86_64_delta_wb2448_config_lookup(const char* setting) +{ + int i; + for(i = 0; x86_64_delta_wb2448_config_settings[i].name; i++) { + if(strcmp(x86_64_delta_wb2448_config_settings[i].name, setting)) { + return x86_64_delta_wb2448_config_settings[i].value; + } + } + return NULL; +} + +int +x86_64_delta_wb2448_config_show(struct aim_pvs_s* pvs) +{ + int i; + for(i = 0; x86_64_delta_wb2448_config_settings[i].name; i++) { + aim_printf(pvs, "%s = %s\n", x86_64_delta_wb2448_config_settings[i].name, x86_64_delta_wb2448_config_settings[i].value); + } + return i; +} + +/* */ + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_enums.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_enums.c new file mode 100755 index 00000000..1d04a7df --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_enums.c @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +/* <--auto.start.enum(ALL).source> */ +/* */ + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h new file mode 100755 index 00000000..1109c568 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h @@ -0,0 +1,13 @@ +/**************************************************************************//** + * + * x86_64_delta_wb2448 Internal Header + * + *****************************************************************************/ + +#ifndef __x86_64_delta_wb2448_INT_H__ +#define __x86_64_delta_wb2448_INT_H__ + +#include + + +#endif /* __x86_64_delta_wb2448_INT_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c new file mode 100755 index 00000000..eb3abedc --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c @@ -0,0 +1,21 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +#include "x86_64_delta_wb2448_log.h" +/* + * x86_64_delta_wb2448 log struct. + */ +AIM_LOG_STRUCT_DEFINE +( + x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT, + x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT, + NULL, /* Custom log map */ + x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT +); + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h new file mode 100755 index 00000000..55ec13b7 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h @@ -0,0 +1,14 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#ifndef __x86_64_delta_wb2448_LOG_H__ +#define __x86_64_delta_wb2448_LOG_H__ + +#define AIM_LOG_MODULE_NAME x86_64_delta_wb2448 +#include + +#endif /* __x86_64_delta_wb2448_LOG_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c new file mode 100755 index 00000000..fde39d68 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c @@ -0,0 +1,26 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +#include "x86_64_delta_wb2448_log.h" + +static int +datatypes_init__(void) +{ +#define x86_64_delta_wb2448_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); +#include + return 0; +} + +void __x86_64_delta_wb2448_module_init__(void) +{ + AIM_LOG_STRUCT_REGISTER(); + datatypes_init__(); +} + +int __onlp_platform_version__ = 1; diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c new file mode 100755 index 00000000..c43247f8 --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c @@ -0,0 +1,64 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ + + +#include + +#if x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI == 1 + +#include +#include +#include + +static ucli_status_t +x86_64_delta_wb2448_ucli_ucli__config__(ucli_context_t* uc) +{ + UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_delta_wb2448) +} + +/* */ +/****************************************************************************** + * + * These handler table(s) were autogenerated from the symbols in this + * source file. + * + *****************************************************************************/ +static ucli_command_handler_f x86_64_delta_wb2448_ucli_ucli_handlers__[] = +{ + x86_64_delta_wb2448_ucli_ucli__config__, + NULL +}; +/******************************************************************************/ +/* */ + +static ucli_module_t +x86_64_delta_wb2448_ucli_module__ = +{ + "x86_64_delta_wb2448_ucli", + NULL, + x86_64_delta_wb2448_ucli_ucli_handlers__, + NULL, + NULL, +}; + +ucli_node_t* +x86_64_delta_wb2448_ucli_node_create(void) +{ + ucli_node_t* n; + ucli_module_init(&x86_64_delta_wb2448_ucli_module__); + n = ucli_node_create("x86_64_delta_wb2448", NULL, &x86_64_delta_wb2448_ucli_module__); + ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_delta_wb2448")); + return n; +} + +#else +void* +x86_64_delta_wb2448_ucli_node_create(void) +{ + return NULL; +} +#endif + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/Makefile b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/Makefile new file mode 100755 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/PKG.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/PKG.yml new file mode 100755 index 00000000..001aa00e --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/PKG.yml @@ -0,0 +1,2 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=delta BASENAME=x86-64-delta-wb2448 REVISION=r0 + diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/lib/x86-64-delta-wb2448-r0.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/lib/x86-64-delta-wb2448-r0.yml new file mode 100755 index 00000000..e71c6aaa --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/lib/x86-64-delta-wb2448-r0.yml @@ -0,0 +1,32 @@ +--- + +###################################################################### +# +# platform-config for DELTA wb2448 +###################################################################### + +x86-64-delta-wb2448-r0: + + grub: + + serial: >- + --port=0x3f8 + --speed=115200 + --word=8 + --parity=no + --stop=1 + + kernel: + <<: *kernel-3-16 + + args: >- + nopat + console=ttyS0,115200n8 + pci=noacpi + acpi_enforce_resources=no + + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:03.0 diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py new file mode 100755 index 00000000..efffe05c --- /dev/null +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py @@ -0,0 +1,16 @@ +from onl.platform.base import * +from onl.platform.delta import * + +class OnlPlatform_x86_64_delta_wb2448_r0(OnlPlatformDELTA, + OnlPlatformPortConfig_48x1_4x10): + PLATFORM='x86-64-delta-wb2448-r0' + MODEL="wb2448" + SYS_OBJECT_ID=".2448.1" + + def baseconfig(self): + + # initiate eeprom + self.new_i2c_device('24c02', 0x53, 0) + + return True + From 5e9bf6ddce9594121129b342df75c782a3e68509 Mon Sep 17 00:00:00 2001 From: vincent0083 Date: Fri, 31 Mar 2017 14:36:35 +0800 Subject: [PATCH 2/2] [WB2448] 1. Change Vendor name from "DELTA" to "Delta". 2. Re-name the Config defines to uppercase. 3. Change all print calls from printf() to AIM_LOG_ERR(). 4. Delete function onlp_sysi_onie_data_free. --- .../platforms/delta/vendor-config/PKG.yml | 2 +- .../src/python/delta/__init__.py | 4 +- .../src/module/auto/x86_64_delta_wb2448.yml | 26 +++--- .../x86_64_delta_wb2448_config.h | 66 +++++++------- .../x86_64_delta_wb2448_dox.h | 6 +- .../x86_64_delta_wb2448_porting.h | 88 +++++++++---------- .../onlp/builds/src/module/src/fani.c | 6 +- .../onlp/builds/src/module/src/ledi.c | 4 +- .../onlp/builds/src/module/src/platform_lib.c | 20 ++--- .../onlp/builds/src/module/src/psui.c | 4 +- .../onlp/builds/src/module/src/sfpi.c | 2 +- .../onlp/builds/src/module/src/sysi.c | 10 --- .../onlp/builds/src/module/src/thermali.c | 2 +- .../module/src/x86_64_delta_wb2448_config.c | 60 ++++++------- .../src/module/src/x86_64_delta_wb2448_int.h | 6 +- .../src/module/src/x86_64_delta_wb2448_log.c | 6 +- .../src/module/src/x86_64_delta_wb2448_log.h | 6 +- .../module/src/x86_64_delta_wb2448_module.c | 2 +- .../src/module/src/x86_64_delta_wb2448_ucli.c | 2 +- .../python/x86_64_delta_wb2448_r0/__init__.py | 2 +- 20 files changed, 157 insertions(+), 167 deletions(-) diff --git a/packages/platforms/delta/vendor-config/PKG.yml b/packages/platforms/delta/vendor-config/PKG.yml index ebd8124a..a203f54d 100755 --- a/packages/platforms/delta/vendor-config/PKG.yml +++ b/packages/platforms/delta/vendor-config/PKG.yml @@ -1 +1 @@ -!include $ONL_TEMPLATES/platform-config-vendor.yml VENDOR=delta Vendor=DELTA +!include $ONL_TEMPLATES/platform-config-vendor.yml VENDOR=delta Vendor=Delta diff --git a/packages/platforms/delta/vendor-config/src/python/delta/__init__.py b/packages/platforms/delta/vendor-config/src/python/delta/__init__.py index e84ef9fc..d0f21891 100755 --- a/packages/platforms/delta/vendor-config/src/python/delta/__init__.py +++ b/packages/platforms/delta/vendor-config/src/python/delta/__init__.py @@ -2,6 +2,6 @@ from onl.platform.base import * -class OnlPlatformDELTA(OnlPlatformBase): - MANUFACTURER='DELTA' +class OnlPlatformDelta(OnlPlatformBase): + MANUFACTURER='Delta' PRIVATE_ENTERPRISE_NUMBER=2254 diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml index ccfd3bec..12c0e79e 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/auto/x86_64_delta_wb2448.yml @@ -5,45 +5,45 @@ ############################################################################### cdefs: &cdefs -- x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING: +- X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING: doc: "Include or exclude logging." default: 1 -- x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT: +- X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT: doc: "Default enabled log options." default: AIM_LOG_OPTIONS_DEFAULT -- x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT: +- X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT: doc: "Default enabled log bits." default: AIM_LOG_BITS_DEFAULT -- x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT: +- X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT: doc: "Default enabled custom log bits." default: 0 -- x86_64_delta_wb2448_CONFIG_PORTING_STDLIB: +- X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB: doc: "Default all porting macros to use the C standard libraries." default: 1 -- x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: +- X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: doc: "Include standard library headers for stdlib porting macros." - default: X86_64_delta_wb2448_CONFIG_PORTING_STDLIB -- x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI: + default: X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB +- X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI: doc: "Include generic uCli support." default: 0 -- x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION: +- X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION: doc: "Assume chassis fan direction is the same as the PSU fan direction." default: 0 -- x86_64_delta_wb2448_CONFIG_SFP_COUNT: +- X86_64_DELTA_WB2448_CONFIG_SFP_COUNT: doc: "SFP port numbers." default: 4 -- x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX: +- X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX: doc: "Max fan speed." default: 18000 definitions: cdefs: - x86_64_delta_wb2448_CONFIG_HEADER: + X86_64_DELTA_WB2448_CONFIG_HEADER: defs: *cdefs basename: x86_64_delta_wb2448_config portingmacro: - x86_64_delta_wb2448: + X86_64_DELTA_WB2448: macros: - malloc - free diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h index 67dbd3b6..4f07a1fc 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_config.h @@ -7,116 +7,116 @@ * @{ * *****************************************************************************/ -#ifndef __x86_64_delta_wb2448_CONFIG_H__ -#define __x86_64_delta_wb2448_CONFIG_H__ +#ifndef __X86_64_DELTA_WB2448_CONFIG_H__ +#define __X86_64_DELTA_WB2448_CONFIG_H__ #ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG #include #endif -#ifdef x86_64_delta_wb2448_INCLUDE_CUSTOM_CONFIG +#ifdef X86_64_DELTA_WB2448_INCLUDE_CUSTOM_CONFIG #include #endif /* */ #include /** - * x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING + * X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING * * Include or exclude logging. */ -#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING -#define x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING 1 +#ifndef X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING +#define X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING 1 #endif /** - * x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT + * X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT * * Default enabled log options. */ -#ifndef x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT -#define x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT +#ifndef X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT +#define X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT #endif /** - * x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT + * X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT * * Default enabled log bits. */ -#ifndef x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT -#define x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT +#ifndef X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT +#define X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT #endif /** - * x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT + * X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT * * Default enabled custom log bits. */ -#ifndef x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT -#define x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0 +#ifndef X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT +#define X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0 #endif /** - * x86_64_delta_wb2448_CONFIG_PORTING_STDLIB + * X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB * * Default all porting macros to use the C standard libraries. */ -#ifndef x86_64_delta_wb2448_CONFIG_PORTING_STDLIB -#define x86_64_delta_wb2448_CONFIG_PORTING_STDLIB 1 +#ifndef X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB +#define X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB 1 #endif /** - * x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + * X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS * * Include standard library headers for stdlib porting macros. */ -#ifndef x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS -#define x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS x86_64_delta_wb2448_CONFIG_PORTING_STDLIB +#ifndef X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS +#define X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB #endif /** - * x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI + * X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI * * Include generic uCli support. */ -#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI -#define x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI 0 +#ifndef X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI +#define X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI 0 #endif /** - * x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + * X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION * * Assume chassis fan direction is the same as the PSU fan direction. */ -#ifndef x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION -#define x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0 +#ifndef X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION +#define X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0 #endif /** - * x86_64_delta_wb2448_CONFIG_SFP_COUNT + * X86_64_DELTA_WB2448_CONFIG_SFP_COUNT * * SFP port numbers. */ -#ifndef x86_64_delta_wb2448_CONFIG_SFP_COUNT -#define x86_64_delta_wb2448_CONFIG_SFP_COUNT 4 +#ifndef X86_64_DELTA_WB2448_CONFIG_SFP_COUNT +#define X86_64_DELTA_WB2448_CONFIG_SFP_COUNT 4 #endif /** - * x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX + * X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX * * Max fan speed. */ -#ifndef x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX -#define x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX 18000 +#ifndef X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX +#define X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX 18000 #endif /** diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h index 9863573e..f5b6f6a0 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_dox.h @@ -3,8 +3,8 @@ * x86_64_delta_wb2448 Doxygen Header * *****************************************************************************/ -#ifndef __x86_64_delta_wb2448_DOX_H__ -#define __x86_64_delta_wb2448_DOX_H__ +#ifndef __X86_64_DELTA_WB2448_DOX_H__ +#define _X86_64_DELTA_WB2448_DOX_H__ /** * @defgroup x86_64_delta_wb2448 x86_64_delta_wb2448 - x86_64_delta_wb2448 Description @@ -23,4 +23,4 @@ The documentation overview for this module should go here. * */ -#endif /* __x86_64_delta_wb2448_DOX_H__ */ +#endif /* __X86_64_DELTA_WB2448_DOX_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h index a2b8983b..b03cc15c 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/inc/x86_64_delta_wb2448/x86_64_delta_wb2448_porting.h @@ -7,12 +7,12 @@ * @{ * *****************************************************************************/ -#ifndef __x86_64_delta_wb2448_PORTING_H__ -#define __x86_64_delta_wb2448_PORTING_H__ +#ifndef __X86_64_DELTA_WB2448_PORTING_H__ +#define __X86_64_DELTA_WB2448_PORTING_H__ /* */ -#if x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1 +#if X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1 #include #include #include @@ -20,88 +20,88 @@ #include #endif -#ifndef x86_64_delta_wb2448_MALLOC +#ifndef X86_64_DELTA_WB2448_MALLOC #if defined(GLOBAL_MALLOC) - #define x86_64_delta_wb2448_MALLOC GLOBAL_MALLOC - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_MALLOC malloc + #define X86_64_DELTA_WB2448_MALLOC GLOBAL_MALLOC + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_MALLOC malloc #else - #error The macro x86_64_delta_wb2448_MALLOC is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_MALLOC is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_FREE +#ifndef X86_64_DELTA_WB2448_FREE #if defined(GLOBAL_FREE) - #define x86_64_delta_wb2448_FREE GLOBAL_FREE - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_FREE free + #define X86_64_DELTA_WB2448_FREE GLOBAL_FREE + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_FREE free #else - #error The macro x86_64_delta_wb2448_FREE is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_FREE is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_MEMSET +#ifndef X86_64_DELTA_WB2448_MEMSET #if defined(GLOBAL_MEMSET) - #define x86_64_delta_wb2448_MEMSET GLOBAL_MEMSET - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_MEMSET memset + #define X86_64_DELTA_WB2448_MEMSET GLOBAL_MEMSET + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_MEMSET memset #else - #error The macro x86_64_delta_wb2448_MEMSET is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_MEMSET is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_MEMCPY +#ifndef X86_64_DELTA_WB2448_MEMCPY #if defined(GLOBAL_MEMCPY) - #define x86_64_delta_wb2448_MEMCPY GLOBAL_MEMCPY - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_MEMCPY memcpy + #define X86_64_DELTA_WB2448_MEMCPY GLOBAL_MEMCPY + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_MEMCPY memcpy #else - #error The macro x86_64_delta_wb2448_MEMCPY is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_MEMCPY is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_STRNCPY +#ifndef X86_64_DELTA_WB2448_STRNCPY #if defined(GLOBAL_STRNCPY) - #define x86_64_delta_wb2448_STRNCPY GLOBAL_STRNCPY - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_STRNCPY strncpy + #define X86_64_DELTA_WB2448_STRNCPY GLOBAL_STRNCPY + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_STRNCPY strncpy #else - #error The macro x86_64_delta_wb2448_STRNCPY is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_STRNCPY is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_VSNPRINTF +#ifndef X86_64_DELTA_WB2448_VSNPRINTF #if defined(GLOBAL_VSNPRINTF) - #define x86_64_delta_wb2448_VSNPRINTF GLOBAL_VSNPRINTF - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_VSNPRINTF vsnprintf + #define X86_64_DELTA_WB2448_VSNPRINTF GLOBAL_VSNPRINTF + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_VSNPRINTF vsnprintf #else - #error The macro x86_64_delta_wb2448_VSNPRINTF is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_VSNPRINTF is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_SNPRINTF +#ifndef X86_64_DELTA_WB2448_SNPRINTF #if defined(GLOBAL_SNPRINTF) - #define x86_64_delta_wb2448_SNPRINTF GLOBAL_SNPRINTF - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_SNPRINTF snprintf + #define X86_64_DELTA_WB2448_SNPRINTF GLOBAL_SNPRINTF + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_SNPRINTF snprintf #else - #error The macro x86_64_delta_wb2448_SNPRINTF is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_SNPRINTF is required but cannot be defined. #endif #endif -#ifndef x86_64_delta_wb2448_STRLEN +#ifndef X86_64_DELTA_WB2448_STRLEN #if defined(GLOBAL_STRLEN) - #define x86_64_delta_wb2448_STRLEN GLOBAL_STRLEN - #elif x86_64_delta_wb2448_CONFIG_PORTING_STDLIB == 1 - #define x86_64_delta_wb2448_STRLEN strlen + #define X86_64_DELTA_WB2448_STRLEN GLOBAL_STRLEN + #elif X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB == 1 + #define X86_64_DELTA_WB2448_STRLEN strlen #else - #error The macro x86_64_delta_wb2448_STRLEN is required but cannot be defined. + #error The macro X86_64_DELTA_WB2448_STRLEN is required but cannot be defined. #endif #endif /* */ -#endif /* __x86_64_delta_wb2448_PORTING_H__ */ +#endif /* __X86_64_DELTA_WB2448_PORTING_H__ */ /* @} */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c index 4f58463e..7177f870 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/fani.c @@ -99,14 +99,14 @@ onlp_fani_info_get(onlp_oid_t id, onlp_fan_info_t* info) break; default: - printf("Invalid Fan ID!!\n"); + AIM_LOG_ERROR("Invalid Fan ID!!\n"); rv = ONLP_STATUS_E_PARAM; } if(rv == ONLP_STATUS_OK) { info->rpm = u4Data; - info->percentage = (info->rpm * 100) / x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX; + info->percentage = (info->rpm * 100) / X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX; } return rv; @@ -123,7 +123,7 @@ onlp_fani_percentage_set(onlp_oid_t id, int p) if ( p < 0 || p > 100) { - printf("Invalid fan percentage !!"); + AIM_LOG_ERROR("Invalid fan percentage !!"); return ONLP_STATUS_E_PARAM; } diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c index fb071133..39e50c13 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/ledi.c @@ -187,7 +187,7 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) break; default: - printf("Invalid LED ID!!\n"); + AIM_LOG_ERROR("Invalid LED ID!!\n"); rv = ONLP_STATUS_E_PARAM; } @@ -276,7 +276,7 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) default: rv = ONLP_STATUS_E_PARAM; - printf("Invalid LED ID!!\n"); + AIM_LOG_ERROR("Invalid LED ID!!\n"); } if(rv == ONLP_STATUS_OK) diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c index f7b70a43..e19b28fa 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/platform_lib.c @@ -81,7 +81,7 @@ INT4 ifnOS_LINUX_BmcI2CGet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrL else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); } pclose(pFd); @@ -89,7 +89,7 @@ INT4 ifnOS_LINUX_BmcI2CGet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrL else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); } return i4Ret; @@ -125,7 +125,7 @@ INT4 ifnOS_LINUX_BmcI2CSet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrL sprintf(ai1Cmd, "ipmitool raw 0x38 0x5 %d %d %d %d %d %d %d", u1Bus, u1Dev, u4Addr, ((u4Data&0xFF000000)>>24), ((u4Data&0xFF0000)>>16), ((u4Data&0xFF00)>>8), (u4Data&0xFF)); break; default: - printf("ERR: Unsupported data length: %d", u1DataLen); + AIM_LOG_ERROR("ERR: Unsupported data length: %d", u1DataLen); } pFd = popen(ai1Cmd, "r"); @@ -137,7 +137,7 @@ INT4 ifnOS_LINUX_BmcI2CSet(UINT1 u1Bus, UINT1 u1Dev, UINT4 u4Addr, UINT1 u1AddrL else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); } return i4Ret; @@ -175,12 +175,12 @@ INT4 ifnOS_LINUX_BmcI2CProbe(UINT1 u1Bus, UINT1 u1Dev) u4Data += (UINT1)MMI_XTOI(au1Temp); if (u4Data != 0x00) - printf("Probe failed (ret: %d)", i4Ret); + AIM_LOG_ERROR("Probe failed (ret: %d)", i4Ret); } else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); } pclose(pFd); @@ -188,7 +188,7 @@ INT4 ifnOS_LINUX_BmcI2CProbe(UINT1 u1Bus, UINT1 u1Dev) else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); } return i4Ret; @@ -231,7 +231,7 @@ INT4 ifnBmcFanSpeedGet(INT1 *pi1FanName, UINT4 *pu4RetData) else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Command \"%s\": Get Data Failed (ret: %d)", ai1Cmd, i4Ret); } pclose(pFd); @@ -239,7 +239,7 @@ INT4 ifnBmcFanSpeedGet(INT1 *pi1FanName, UINT4 *pu4RetData) else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); } return i4Ret; @@ -270,7 +270,7 @@ INT4 ifnBmcFanSpeedSet(UINT4 u4FanNumber, UINT4 u4Percentage) else { i4Ret = ONLP_STATUS_E_INTERNAL; - printf("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); + AIM_LOG_ERROR("Execute command \"%s\" failed (ret: %d)", ai1Cmd, i4Ret); } return i4Ret; diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c index fc18afeb..9742844a 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/psui.c @@ -92,7 +92,7 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info) } else { - printf("Unable to read PSU present status: %d\r\n", rv); + AIM_LOG_ERROR("Unable to read PSU present status: %d\r\n", rv); } info->status |= ONLP_PSU_STATUS_PRESENT; @@ -110,7 +110,7 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info) } else { - printf("Unable to read PSU failed/good status: %d\r\n", rv); + AIM_LOG_ERROR("Unable to read PSU failed/good status: %d\r\n", rv); } return rv; diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c index bdc1d475..323393f9 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sfpi.c @@ -28,7 +28,7 @@ #define SFP_PORT_BASE 49 -static int sfp_count__ = x86_64_delta_wb2448_CONFIG_SFP_COUNT; +static int sfp_count__ = X86_64_DELTA_WB2448_CONFIG_SFP_COUNT; int onlp_sfpi_init(void) diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c index ac3a0795..e40f4592 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/sysi.c @@ -100,16 +100,6 @@ onlp_sysi_platform_info_free(onlp_platform_info_t* pi) aim_free(pi->cpld_versions); } -void -onlp_sysi_onie_data_free(uint8_t* data) -{ - /* - * We returned a static array in onlp_sysi_onie_data_get() - * so no free operation is required. - */ -} - - int onlp_sysi_oids_get(onlp_oid_t* table, int max) { diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c index 17eab59e..2293ea15 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/thermali.c @@ -139,7 +139,7 @@ onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info) break; default: - printf("Invalid Thermal ID!!\n"); + AIM_LOG_ERROR("Invalid Thermal ID!!\n"); return ONLP_STATUS_E_PARAM; } diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c index 673e501f..e6e668f9 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_config.c @@ -12,55 +12,55 @@ #define __x86_64_delta_wb2448_config_STRINGIFY_VALUE(_x) __x86_64_delta_wb2448_config_STRINGIFY_NAME(_x) x86_64_delta_wb2448_config_settings_t x86_64_delta_wb2448_config_settings[] = { -#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING) }, #else -{ x86_64_delta_wb2448_CONFIG_INCLUDE_LOGGING(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_INCLUDE_LOGGING(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT) }, #else -{ x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT) }, #else -{ x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, #else -{ x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_PORTING_STDLIB - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_PORTING_STDLIB), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_PORTING_STDLIB) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB) }, #else -{ x86_64_delta_wb2448_CONFIG_PORTING_STDLIB(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_PORTING_STDLIB(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, #else -{ x86_64_delta_wb2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI) }, #else -{ x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) }, #else -{ x86_64_delta_wb2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_SFP_COUNT - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_SFP_COUNT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_SFP_COUNT) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_SFP_COUNT + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_SFP_COUNT), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_SFP_COUNT) }, #else -{ x86_64_delta_wb2448_CONFIG_SFP_COUNT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_SFP_COUNT(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif -#ifdef x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX - { __x86_64_delta_wb2448_config_STRINGIFY_NAME(x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX) }, +#ifdef X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX + { __x86_64_delta_wb2448_config_STRINGIFY_NAME(X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX), __x86_64_delta_wb2448_config_STRINGIFY_VALUE(X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX) }, #else -{ x86_64_delta_wb2448_CONFIG_FAN_RPM_MAX(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, +{ X86_64_DELTA_WB2448_CONFIG_FAN_RPM_MAX(__x86_64_delta_wb2448_config_STRINGIFY_NAME), "__undefined__" }, #endif { NULL, NULL } }; diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h index 1109c568..af8c7af5 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_int.h @@ -4,10 +4,10 @@ * *****************************************************************************/ -#ifndef __x86_64_delta_wb2448_INT_H__ -#define __x86_64_delta_wb2448_INT_H__ +#ifndef __X86_64_DELTA_WB2448_INT_H__ +#define __X86_64_DELTA_WB2448_INT_H__ #include -#endif /* __x86_64_delta_wb2448_INT_H__ */ +#endif /* __X86_64_DELTA_WB2448_INT_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c index eb3abedc..142ae946 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.c @@ -13,9 +13,9 @@ */ AIM_LOG_STRUCT_DEFINE ( - x86_64_delta_wb2448_CONFIG_LOG_OPTIONS_DEFAULT, - x86_64_delta_wb2448_CONFIG_LOG_BITS_DEFAULT, + X86_64_DELTA_WB2448_CONFIG_LOG_OPTIONS_DEFAULT, + X86_64_DELTA_WB2448_CONFIG_LOG_BITS_DEFAULT, NULL, /* Custom log map */ - x86_64_delta_wb2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT + X86_64_DELTA_WB2448_CONFIG_LOG_CUSTOM_BITS_DEFAULT ); diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h index 55ec13b7..c8a232c4 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_log.h @@ -5,10 +5,10 @@ *****************************************************************************/ -#ifndef __x86_64_delta_wb2448_LOG_H__ -#define __x86_64_delta_wb2448_LOG_H__ +#ifndef __X86_64_DELTA_WB2448_LOG_H__ +#define __X86_64_DELTA_WB2448_LOG_H__ #define AIM_LOG_MODULE_NAME x86_64_delta_wb2448 #include -#endif /* __x86_64_delta_wb2448_LOG_H__ */ +#endif /* __X86_64_DELTA_WB2448_LOG_H__ */ diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c index fde39d68..d8b8a876 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_module.c @@ -12,7 +12,7 @@ static int datatypes_init__(void) { -#define x86_64_delta_wb2448_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); +#define x86_64_DELTA_WB2448_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); #include return 0; } diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c index c43247f8..cb8fd444 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/onlp/builds/src/module/src/x86_64_delta_wb2448_ucli.c @@ -7,7 +7,7 @@ #include -#if x86_64_delta_wb2448_CONFIG_INCLUDE_UCLI == 1 +#if X86_64_DELTA_WB2448_CONFIG_INCLUDE_UCLI == 1 #include #include diff --git a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py index efffe05c..4b83c4be 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py +++ b/packages/platforms/delta/x86-64/x86-64-delta-wb2448/platform-config/r0/src/python/x86_64_delta_wb2448_r0/__init__.py @@ -1,7 +1,7 @@ from onl.platform.base import * from onl.platform.delta import * -class OnlPlatform_x86_64_delta_wb2448_r0(OnlPlatformDELTA, +class OnlPlatform_x86_64_delta_wb2448_r0(OnlPlatformDelta, OnlPlatformPortConfig_48x1_4x10): PLATFORM='x86-64-delta-wb2448-r0' MODEL="wb2448"