From b2fe569a0439b594837ad1a76e14f480e427c914 Mon Sep 17 00:00:00 2001 From: leo lin Date: Fri, 3 May 2019 17:49:51 +0800 Subject: [PATCH 1/6] [platform] update ingrasys platform change --- .../installer.conf | 1 + .../installer.conf | 1 + .../installer.conf | 1 + .../x86_64-ingrasys_s9100-r0/installer.conf | 1 + .../installer.conf | 1 + .../installer.conf | 1 + .../plugins/eeprom.py | 2 +- .../installer.conf | 1 + .../installer.conf | 1 + .../installer.conf | 1 + platform/barefoot/bfn-platform-ingrasys.mk | 6 ++-- platform/barefoot/rules.mk | 2 +- .../s9180-32x/utils/i2c_utils.sh | 30 +++++++++++-------- .../s9280-64x/utils/i2c_utils.sh | 9 ++++-- .../s9130-32x/utils/i2c_utils.sh | 9 ++++-- .../s9230-64x/utils/i2c_utils.sh | 9 +++++- 16 files changed, 54 insertions(+), 22 deletions(-) diff --git a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/installer.conf index 14404194ef53..662866c2b55f 100644 --- a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/installer.conf index 14404194ef53..662866c2b55f 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/installer.conf index 14404194ef53..662866c2b55f 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf index 14404194ef53..662866c2b55f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9100-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9130_32x-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9130_32x-r0/installer.conf index 925a32fc0c3a..8b646c809b9f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9130_32x-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9130_32x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/installer.conf index 925a32fc0c3a..8b646c809b9f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/plugins/eeprom.py b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/plugins/eeprom.py index d1270eeffbf6..a0ee74ad7dbb 100644 --- a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/plugins/eeprom.py +++ b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/plugins/eeprom.py @@ -18,5 +18,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0055/eeprom" + self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0051/eeprom" super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/ingrasys/x86_64-ingrasys_s9200_64x-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9200_64x-r0/installer.conf index 925a32fc0c3a..8b646c809b9f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9200_64x-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9200_64x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/installer.conf index 925a32fc0c3a..8b646c809b9f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf b/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf index 925a32fc0c3a..8b646c809b9f 100644 --- a/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf +++ b/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" diff --git a/platform/barefoot/bfn-platform-ingrasys.mk b/platform/barefoot/bfn-platform-ingrasys.mk index 20dc5f866f38..3d3015bdfc58 100644 --- a/platform/barefoot/bfn-platform-ingrasys.mk +++ b/platform/barefoot/bfn-platform-ingrasys.mk @@ -1,5 +1,7 @@ -BFN_INGRASYS_PLATFORM = bfnplatform-ingrasys_8.2.0_amd64.deb -$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_8.4.0_8.5.0_amd64.deb" +ifdef BLDENV +BFN_INGRASYS_PLATFORM = bfnplatform-ingrasys_8.8.1_docker_amd64.deb +$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_8.8.1_amd64.deb" +endif SONIC_ONLINE_DEBS += $(BFN_INGRASYS_PLATFORM) # $(BFN_SAI_DEV) $(BFN_SAI_DEV)_DEPENDS += $(BFN_INGRASYS_PLATFORM) diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index ea718d10fc96..e54d5ff40770 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -12,7 +12,7 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/docker-ptf-bfn.mk include $(PLATFORM_PATH)/bfn-platform.mk #include $(PLATFORM_PATH)/bfn-platform-wnc.mk -#include $(PLATFORM_PATH)/bfn-platform-ingrasys.mk +include $(PLATFORM_PATH)/bfn-platform-ingrasys.mk include $(PLATFORM_PATH)/bfn-modules.mk SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT) \ diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh index d8e5778f4b0e..39581f6e54c1 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh @@ -174,12 +174,18 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" + depmod -a + rmmod eeprom rmmod i2c_i801 + rmmod optoe + rmmod sff_8436_eeprom modprobe i2c_i801 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 #modprobe cpld_wdt + modprobe sff_8436_eeprom + modprobe optoe if [ ! -e "${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX1_CHAN0_DEVICE}" ]; then _retry "echo 'pca9548 0x70' > ${PATH_I801_DEVICE}/new_device" @@ -240,9 +246,7 @@ function _i2c_init { _i2c_fan_speed_init _i2c_temp_init modprobe jc42 - rmmod gpio_ich _i2c_gpio_init - modprobe gpio_ich _i2c_mb_eeprom_init "new" _i2c_qsfp_eeprom_init "new" _i2c_sfp_eeprom_init "new" @@ -644,9 +648,10 @@ function _i2c_gpio_init { do echo $i > /sys/class/gpio/export echo 1 > /sys/class/gpio/gpio${i}/active_low - echo low > /sys/class/gpio/gpio${i}/direction - #echo out > /sys/class/gpio/gpio${i}/direction - #echo 0 > /sys/class/gpio/gpio${i}/value + # value low for gpio direction not official support + #echo low > /sys/class/gpio/gpio${i}/direction + echo out > /sys/class/gpio/gpio${i}/direction + echo 0 > /sys/class/gpio/gpio${i}/value done #RST Port 16-31 @@ -656,9 +661,10 @@ function _i2c_gpio_init { do echo $i > /sys/class/gpio/export echo 1 > /sys/class/gpio/gpio${i}/active_low - echo low > /sys/class/gpio/gpio${i}/direction - #echo out > /sys/class/gpio/gpio${i}/direction - #echo 0 > /sys/class/gpio/gpio${i}/value + # value low for gpio direction not official support + #echo low > /sys/class/gpio/gpio${i}/direction + echo out > /sys/class/gpio/gpio${i}/direction + echo 0 > /sys/class/gpio/gpio${i}/value done #PSU I/O on Dummy Board 0x25 @@ -1129,10 +1135,10 @@ function _i2c_sfp_eeprom_init { if [ "${action}" == "new" ] && \ ! [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP1_DEVICE}-0050 ] && \ ! [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP2_DEVICE}-0050 ]; then - #echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device - #echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device - echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device - echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device + echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device + echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device + #echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device + #echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device elif [ "${action}" == "delete" ] && \ [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP1_DEVICE}-0050 ] && \ [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP2_DEVICE}-0050 ]; then diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh index dcd7bf717339..ce54b775ffb4 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh @@ -383,6 +383,8 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" + depmod -a + #remove optoe module rmmod optoe @@ -494,6 +496,9 @@ function _i2c_init { _util_rmmod eeprom modprobe eeprom_mb modprobe gpio-pca953x + modprobe sff_8436_eeprom + modprobe optoe + _i2c_io_exp_init _i2c_sensors_init _i2c_cpld_init @@ -1160,8 +1165,8 @@ function _i2c_sfp_eeprom_init { if [ "${action}" == "new" ] && \ ! [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then - #echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device - echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device + echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device + #echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device elif [ "${action}" == "delete" ] && \ [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then echo "$eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/delete_device diff --git a/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh b/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh index ea238e01729a..764c5235f80f 100755 --- a/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh +++ b/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh @@ -250,9 +250,13 @@ function _i2c_init { #rmmod i2c_ismt _util_rmmod i2c_i801 + _util_rmmod optoe + _util_rmmod sff_8436_eeprom modprobe i2c_i801 disable_features=0x10 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 + modprobe sff_8436_eeprom + modprobe optoe # add MUX PCA9548#0 on I801, assume to be i2c-1~8 if [ ! -e ${PATH_MUX_9548_0_CH0} ]; then @@ -302,9 +306,7 @@ function _i2c_init { modprobe eeprom_mb modprobe gpio-pca953x _i2c_io_exp_init - rmmod gpio_ich _i2c_gpio_init - modprobe gpio_ich _i2c_sensors_init _i2c_psu_init @@ -1144,7 +1146,8 @@ function _i2c_qsfp_eeprom_init { if [ "${action}" == "new" ] && \ ! [ -L ${PATH_SYS_I2C_DEVICES}/$eeprombus-$(printf "%04x" $eepromAddr) ]; then - echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eeprombus/new_device + #echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eeprombus/new_device + echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eeprombus/new_device elif [ "${action}" == "delete" ] && \ [ -L ${PATH_SYS_I2C_DEVICES}/$eeprombus-$(printf "%04x" $eepromAddr) ]; then echo "$eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eeprombus/delete_device diff --git a/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh b/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh index e899e64a7c3b..84caaefe6674 100755 --- a/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh +++ b/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh @@ -333,11 +333,17 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" + depmod -a + #rmmod i2c_ismt _util_rmmod i2c_i801 + _util_rmmod optoe + _util_rmmod sff_8436_eeprom modprobe i2c_i801 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 + modprobe sff_8436_eeprom + modprobe optoe # add MUX PCA9548#0 on I801, assume to be i2c-1~8 if [ ! -e ${PATH_MUX_9548_0_CH0} ]; then @@ -1022,7 +1028,8 @@ function _i2c_qsfp_eeprom_init { if [ "${action}" == "new" ] && \ ! [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then - echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device + #echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device + echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device elif [ "${action}" == "delete" ] && \ [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then echo "$eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/delete_device From 7a0d09d6d5049305bbfc18e666eeaf488b9d46fa Mon Sep 17 00:00:00 2001 From: leo lin Date: Tue, 7 May 2019 14:47:24 +0800 Subject: [PATCH 2/6] [s9230] update vdd_code voltage max value due to layout design --- device/ingrasys/x86_64-ingrasys_s9230_64x-r0/sensors.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/sensors.conf b/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/sensors.conf index 84abfe88062b..ff1f78113837 100644 --- a/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/sensors.conf +++ b/device/ingrasys/x86_64-ingrasys_s9230_64x-r0/sensors.conf @@ -9,7 +9,7 @@ chip "w83795adg-*" ignore in0 label in1 "VDD_CORE" set in1_min 0.90 * 0.98 - set in1_max 0.90 * 1.02 + set in1_max 0.936 ignore in2 label in3 "1.8V" set in3_min 1.8 * 0.97 From a2ae2d109049bf940e7c30b62890dfca6da9a903 Mon Sep 17 00:00:00 2001 From: leo lin Date: Thu, 6 Jun 2019 11:46:47 +0800 Subject: [PATCH 3/6] [nephos/barefoot] enhance platform init sequence --- .../s9180-32x/utils/i2c_utils.sh | 15 ++++----------- .../s9280-64x/utils/i2c_utils.sh | 13 +++---------- .../s9130-32x/utils/i2c_utils.sh | 15 ++++----------- .../s9230-64x/utils/i2c_utils.sh | 15 ++++----------- 4 files changed, 15 insertions(+), 43 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh index 39581f6e54c1..a2129a5b279e 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh @@ -176,10 +176,9 @@ function _i2c_init { depmod -a - rmmod eeprom - rmmod i2c_i801 - rmmod optoe - rmmod sff_8436_eeprom + # invoke deinit to make sure init sequence + _i2c_deinit + modprobe i2c_i801 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 @@ -228,12 +227,6 @@ function _i2c_init { echo "${PATH_MAIN_MUX_CHAN0_DEVICE} 0x72 already init." fi - rmmod coretemp - rmmod jc42 - rmmod w83795 - rmmod lm75 - rmmod lm90 - rmmod eeprom modprobe coretemp modprobe w83795 modprobe lm75 @@ -289,7 +282,7 @@ function _mac_vdd_init { #I2C Deinit function _i2c_deinit { _i2c_gpio_deinit - for mod in coretemp jc42 w83795 lm75 lm90 eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_ismt i2c_i801; + for mod in coretemp jc42 w83795 lm75 lm90 optoe sff_8436_eeprom eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_ismt i2c_i801; do [ "$(lsmod | grep "^$mod ")" != "" ] && rmmod $mod done diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh index ce54b775ffb4..e5864a891869 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh @@ -385,11 +385,9 @@ function _i2c_init { depmod -a - #remove optoe module - rmmod optoe + # invoke deinit to make sure init sequence + _i2c_deinit - #rmmod i2c_ismt - _util_rmmod i2c_i801 modprobe i2c_i801 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 @@ -552,7 +550,7 @@ function _mac_vdd_init { #I2C Deinit function _i2c_deinit { echo "i2c deinit..." - for mod in coretemp jc42 w83795 ingrasys_s9280_64x_psu ingrasys_s9280_64x_i2c_cpld eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801; + for mod in coretemp jc42 w83795 ingrasys_s9280_64x_psu ingrasys_s9280_64x_i2c_cpld optoe sff_8436_eeprom eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801; do _util_rmmod $mod done @@ -584,11 +582,6 @@ function _i2c_sensors_init { echo "SENSORS init..." local dev_path # to make sure hwmon index in sysfs as expected, - # need to remove kernel module and then probe them in expected order - # remove all sensors kernel module - _util_rmmod coretemp - _util_rmmod jc42 - _util_rmmod w83795 # probe coretemp kernel module modprobe coretemp #hwmon0 # probe hwmon kernel module diff --git a/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh b/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh index 764c5235f80f..b5c9f216d6f1 100755 --- a/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh +++ b/platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh @@ -248,10 +248,9 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" - #rmmod i2c_ismt - _util_rmmod i2c_i801 - _util_rmmod optoe - _util_rmmod sff_8436_eeprom + # invoke deinit to make sure init sequence + _i2c_deinit + modprobe i2c_i801 disable_features=0x10 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 @@ -302,7 +301,6 @@ function _i2c_init { fi _i2c_hwm_init - _util_rmmod eeprom modprobe eeprom_mb modprobe gpio-pca953x _i2c_io_exp_init @@ -336,7 +334,7 @@ function _i2c_init { function _i2c_deinit { echo "i2c deinit..." _i2c_gpio_deinit - for mod in coretemp jc42 w83795 eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801 ingrasys_s9130_32x_psu; + for mod in coretemp jc42 w83795 optoe sff_8436_eeprom eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801 ingrasys_s9130_32x_psu; do _util_rmmod $mod done @@ -347,11 +345,6 @@ function _i2c_sensors_init { echo "SENSORS init..." local dev_path # to make sure hwmon index in sysfs as expected, - # need to remove kernel module and then probe them in expected order - # remove all sensors kernel module - _util_rmmod coretemp - _util_rmmod jc42 - _util_rmmod w83795 # probe coretemp kernel module modprobe coretemp # probe hwmon kernel module diff --git a/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh b/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh index 84caaefe6674..29793541e358 100755 --- a/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh +++ b/platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh @@ -335,10 +335,9 @@ function _i2c_init { depmod -a - #rmmod i2c_ismt - _util_rmmod i2c_i801 - _util_rmmod optoe - _util_rmmod sff_8436_eeprom + # invoke deinit to make sure init sequence + _i2c_deinit + modprobe i2c_i801 modprobe i2c_dev modprobe i2c_mux_pca954x force_deselect_on_exit=1 @@ -437,7 +436,6 @@ function _i2c_init { fi _i2c_hwm_init - _util_rmmod eeprom modprobe eeprom_mb modprobe gpio-pca953x _i2c_io_exp_init @@ -466,7 +464,7 @@ function _i2c_init { #I2C Deinit function _i2c_deinit { echo "i2c deinit..." - for mod in coretemp jc42 w83795 eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801 ingrasys_s9230_64x_psu; + for mod in coretemp jc42 w83795 optoe sff_8436_eeprom eeprom eeprom_mb gpio-pca953x i2c_mux_pca954x i2c_i801 ingrasys_s9230_64x_psu; do _util_rmmod $mod done @@ -498,11 +496,6 @@ function _i2c_sensors_init { echo "SENSORS init..." local dev_path # to make sure hwmon index in sysfs as expected, - # need to remove kernel module and then probe them in expected order - # remove all sensors kernel module - _util_rmmod coretemp - _util_rmmod jc42 - _util_rmmod w83795 # probe coretemp kernel module modprobe coretemp # probe hwmon kernel module From 65b95d46894d920d2a255380a58aec76cbbcaf91 Mon Sep 17 00:00:00 2001 From: leo lin Date: Thu, 6 Jun 2019 11:52:53 +0800 Subject: [PATCH 4/6] [barefoot] fix modprobe fail after installation --- .../debian/sonic-platform-ingrasys-s9180-32x.postinst | 5 +++++ .../debian/sonic-platform-ingrasys-s9280-64x.postinst | 5 +++++ .../s9180-32x/utils/i2c_utils.sh | 2 -- .../s9280-64x/utils/i2c_utils.sh | 2 -- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9180-32x.postinst create mode 100644 platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9280-64x.postinst diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9180-32x.postinst b/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9180-32x.postinst new file mode 100644 index 000000000000..f8f5bf31de76 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9180-32x.postinst @@ -0,0 +1,5 @@ +# postinst script for s9180 + +depmod -a + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9280-64x.postinst b/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9280-64x.postinst new file mode 100644 index 000000000000..1addccc68fc2 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-ingrasys/debian/sonic-platform-ingrasys-s9280-64x.postinst @@ -0,0 +1,5 @@ +# postinst script for s9280 + +depmod -a + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh index a2129a5b279e..f199569f523d 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh @@ -174,8 +174,6 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" - depmod -a - # invoke deinit to make sure init sequence _i2c_deinit diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh index e5864a891869..cd73baf94ca8 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9280-64x/utils/i2c_utils.sh @@ -383,8 +383,6 @@ function _i2c_init { echo "# Description: I2C Init" echo "=========================================================" - depmod -a - # invoke deinit to make sure init sequence _i2c_deinit From 75f48335639c0d54da961741c8f1889d4e0ad351 Mon Sep 17 00:00:00 2001 From: leo lin Date: Thu, 6 Jun 2019 11:54:27 +0800 Subject: [PATCH 5/6] [s9180] remove commented code --- .../s9180-32x/utils/i2c_utils.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh index f199569f523d..0622c4aaf107 100755 --- a/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh +++ b/platform/barefoot/sonic-platform-modules-ingrasys/s9180-32x/utils/i2c_utils.sh @@ -639,8 +639,6 @@ function _i2c_gpio_init { do echo $i > /sys/class/gpio/export echo 1 > /sys/class/gpio/gpio${i}/active_low - # value low for gpio direction not official support - #echo low > /sys/class/gpio/gpio${i}/direction echo out > /sys/class/gpio/gpio${i}/direction echo 0 > /sys/class/gpio/gpio${i}/value done @@ -652,8 +650,6 @@ function _i2c_gpio_init { do echo $i > /sys/class/gpio/export echo 1 > /sys/class/gpio/gpio${i}/active_low - # value low for gpio direction not official support - #echo low > /sys/class/gpio/gpio${i}/direction echo out > /sys/class/gpio/gpio${i}/direction echo 0 > /sys/class/gpio/gpio${i}/value done From 823dd0aca85068466a22700fc5bfc511baf8a733 Mon Sep 17 00:00:00 2001 From: leo lin Date: Mon, 8 Jul 2019 16:52:08 +0800 Subject: [PATCH 6/6] [barefoot] change bf platform deb file name --- platform/barefoot/bfn-platform-ingrasys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/barefoot/bfn-platform-ingrasys.mk b/platform/barefoot/bfn-platform-ingrasys.mk index 3d3015bdfc58..95c3bf691fe1 100644 --- a/platform/barefoot/bfn-platform-ingrasys.mk +++ b/platform/barefoot/bfn-platform-ingrasys.mk @@ -1,6 +1,6 @@ ifdef BLDENV BFN_INGRASYS_PLATFORM = bfnplatform-ingrasys_8.8.1_docker_amd64.deb -$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_8.8.1_amd64.deb" +$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_master_amd64.deb" endif SONIC_ONLINE_DEBS += $(BFN_INGRASYS_PLATFORM) # $(BFN_SAI_DEV)