From 09e0fe6393f0f8e7e911c75f392a3ec188e8cec3 Mon Sep 17 00:00:00 2001 From: Sara Lin Date: Wed, 17 Jul 2024 19:39:26 -0700 Subject: [PATCH] olympic2.0: Support SKU 2.2 T8 and cancel 2.1 T8/RSC2 CacheStore Summary: # Description - Support BMC to determine T8 2.2 from FRU produce name and load the default fan table. - Remove the code about canceled SKU (2.1 T8 and RSC2 CacheStore). # Motivation - The system SKU 2.1 T8 and RSC2 CacheStore are canceled. And need to support new SKU 2.2 T8. X-link: https://github.com/facebookexternal/openbmc.wiwynn/pull/3119 Test Plan: 1. Build pass on greatlakes. 2. Check system SKU and fan table is correct. root@bmc-oob:~# kv get system_sku 2.0 root@bmc-oob:~# fw-util bmc --version fscd Fan Speed Controller Version: Olympic_GL_FSC-V2024.04.24 root@bmc-oob:~# fan-util --get Fan 0 Speed: 3780 RPM (20%) Fan 1 Speed: 3758 RPM (20%) Fan 2 Speed: 3794 RPM (20%) Fan 3 Speed: 3797 RPM (20%) Fan Mode: Normal FSCD Driver: linear_frontIO_inlet(all:slot1_fio_front_temp_c) Sensor Fail: None Fan Fail: None root@bmc-oob:~# kv get system_sku 2.2 root@bmc-oob:~# fw-util bmc --version fscd Fan Speed Controller Version: Olympic_GL_2.2_FSC-V2024.07.15 root@bmc-oob:~# fan-util --get Fan 0 Speed: 10731 RPM (70%) Fan 1 Speed: 10830 RPM (70%) Fan 2 Speed: 10830 RPM (70%) Fan 3 Speed: 10751 RPM (70%) Fan Mode: Normal FSCD Driver: linear_cpu_temp+pid_cpu_temp(all:slot1_mb_soc_cpu_temp_c) Sensor Fail: None Fan Fail: None Reviewed By: amithash Differential Revision: D59803805 fbshipit-source-id: f74e67db35c30b7566539e84413b3e3742eaa1b5 --- ...on => FSC_CLASS1_type8_2.2_GL_config.json} | 4 +- ....fsc => FSC_CLASS1_type8_2.2_GL_zone1.fsc} | 0 .../FSC_CLASS1_type8_RSC_cache_GL_config.json | 264 ------------------ .../FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc | 62 ---- .../recipes-fby35/fscd/fscd/setup-fan.sh | 6 +- .../recipes-fby35/fscd/fscd_0.3.bbappend | 12 +- .../plat-libs/files/pal/pal_sensors.c | 36 --- .../plat-utils/files/setup-sku.sh | 99 +------ 8 files changed, 16 insertions(+), 467 deletions(-) rename meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/{FSC_CLASS1_type8_2.1_GL_config.json => FSC_CLASS1_type8_2.2_GL_config.json} (98%) rename meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/{FSC_CLASS1_type8_2.1_GL_zone1.fsc => FSC_CLASS1_type8_2.2_GL_zone1.fsc} (100%) delete mode 100644 meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_config.json delete mode 100644 meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.1_GL_config.json b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.2_GL_config.json similarity index 98% rename from meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.1_GL_config.json rename to meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.2_GL_config.json index 0a368948aa1e..842ffc2e1132 100644 --- a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.1_GL_config.json +++ b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.2_GL_config.json @@ -1,5 +1,5 @@ { - "version": "Olympic_GL_2.1_FSC-V2024.06.18", + "version": "Olympic_GL_2.2_FSC-V2024.07.15", "pwm_transition_value": 80, "pwm_boost_value": 100, "non_fanfail_limited_boost_value": 100, @@ -258,7 +258,7 @@ "zones": { "zone_1": { "pwm_output": [0], - "expr_file": "FSC_CLASS1_type8_2.1_GL_zone1.fsc" + "expr_file": "FSC_CLASS1_type8_2.2_GL_zone1.fsc" } } } diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.1_GL_zone1.fsc b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.2_GL_zone1.fsc similarity index 100% rename from meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.1_GL_zone1.fsc rename to meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_2.2_GL_zone1.fsc diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_config.json b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_config.json deleted file mode 100644 index dfe493ac524f..000000000000 --- a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_config.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "version": "Olympic_GL_RSC_CACHE_FSC-V2024.06.18", - "pwm_transition_value": 80, - "pwm_boost_value": 100, - "non_fanfail_limited_boost_value": 100, - "sample_interval_ms": 3000, - "sensor_fail_ignore": true, - "sensor_filter_all": true, - "boost": { - "fan_fail": true, - "sensor_fail": true - }, - "fan_dead_boost": { - "threshold": 2, - "action": "host_shutdown" - }, - "sensor_valid_check": { - "(.*)fio_": { - "attribute": { - "type" : "power_status" - } - }, - "(.*)mb_": { - "attribute": { - "type" : "power_status" - } - }, - "(.*)e1s_": { - "attribute": { - "type" : "power_status" - } - } - }, - "watchdog": false, - "min_rpm": 1000, - "profiles": { - "linear_frontIO_inlet": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 1, - "data": [ - [ 20, 70 ], - [ 21, 70 ], - [ 22, 70 ], - [ 23, 70 ], - [ 24, 70 ], - [ 25, 70 ], - [ 26, 70 ], - [ 27, 70 ], - [ 28, 70 ], - [ 29, 70 ], - [ 30, 70 ], - [ 31, 70 ], - [ 32, 70 ], - [ 33, 70 ], - [ 34, 70 ], - [ 35, 70 ], - [ 36, 70 ], - [ 37, 70 ], - [ 38, 70 ], - [ 39, 70 ], - [ 40, 70 ] - ] - }, - "linear_cpu_temp": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 3, - "data": [ - [ 58, 70 ], - [ 59, 70 ], - [ 60, 70 ], - [ 61, 70 ], - [ 62, 70 ], - [ 63, 70 ], - [ 64, 70 ], - [ 65, 70 ] - ] - }, - "pid_cpu_temp": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "pid", - "setpoint": 70, - "negative_hysteresis": 3, - "positive_hysteresis": 0, - "kp": -4.5, - "ki": -0.035, - "kd": 0 - }, - "linear_dimm": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 2, - "data": [ - [65, 70], - [66, 70], - [67, 70], - [68, 70], - [69, 70], - [70, 70] - ] - }, - "pid_dimm": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "pid", - "setpoint": 75, - "negative_hysteresis": 3, - "positive_hysteresis": 1, - "kp": -3, - "ki": -0.03, - "kd": 0 - }, - "linear_nic": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 3, - "data": [ - [80, 70], - [81, 70], - [82, 70], - [83, 70], - [84, 70], - [85, 70], - [86, 70], - [87, 70], - [88, 70], - [89, 70], - [90, 70] - ] - }, - "pid_nic": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "pid", - "setpoint": 95, - "negative_hysteresis": 3, - "positive_hysteresis": 0, - "kp": -3, - "ki": -0.015, - "kd": 0 - }, - "linear_boot_drive": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 3, - "data": [ - [60, 70], - [61, 70], - [62, 70], - [63, 70], - [64, 70], - [65, 70] - ] - }, - "pid_boot_drive": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "pid", - "setpoint": 70, - "negative_hysteresis": 2, - "positive_hysteresis": 1, - "kp": -2, - "ki": -0.02, - "kd": 0 - }, - "linear_e1s_temp": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 2, - "data": [ - [58, 70], - [60, 70], - [62, 70] - ] - }, - "pid_e1s_temp": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "pid", - "setpoint": 70, - "negative_hysteresis": 2, - "positive_hysteresis": 1, - "kp": -1.5, - "ki": -0.02, - "kd": 0 - }, - "linear_non_fru_sensor": { - "read_source" : { - "util" : "/usr/local/bin/sensor-util" - }, - "type": "linear", - "positive_hysteresis": 0, - "negative_hysteresis": 0, - "data": [ - [ 0, 0 ] - ] - } - }, - "fans": { - "0": { - "read_source" : { - "sysfs" : "/sys/class/hwmon/hwmon*/fan1_input" - }, - "write_source" : { - "util" : "/usr/local/bin/fan-util --set %d" - } - }, - "1": { - "read_source" : { - "sysfs" : "/sys/class/hwmon/hwmon*/fan3_input" - }, - "write_source" : { - "util" : "/usr/local/bin/fan-util --set %d" - } - }, - "2": { - "read_source" : { - "sysfs" : "/sys/class/hwmon/hwmon*/fan5_input" - }, - "write_source" : { - "util" : "/usr/local/bin/fan-util --set %d" - } - }, - "3": { - "read_source" : { - "sysfs" : "/sys/class/hwmon/hwmon*/fan7_input" - }, - "write_source" : { - "util" : "/usr/local/bin/fan-util --set %d" - } - } - }, - "zones": { - "zone_1": { - "pwm_output": [0], - "expr_file": "FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc" - } - } -} diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc deleted file mode 100644 index fabea67e1dde..000000000000 --- a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc +++ /dev/null @@ -1,62 +0,0 @@ -max([ - linear_cpu_temp(all:slot1_mb_soc_cpu_temp_c) + pid_cpu_temp(all:slot1_mb_soc_cpu_temp_c), - linear_frontIO_inlet(all:slot1_fio_front_temp_c), - linear_dimm( - max([ - all:slot1_mb_dimma0_temp_c, - all:slot1_mb_dimma1_temp_c, - all:slot1_mb_dimma2_temp_c, - all:slot1_mb_dimma3_temp_c, - all:slot1_mb_dimma4_temp_c, - all:slot1_mb_dimma5_temp_c, - all:slot1_mb_dimma6_temp_c, - all:slot1_mb_dimma7_temp_c])) + - pid_dimm( - max([ - all:slot1_mb_dimma0_temp_c, - all:slot1_mb_dimma1_temp_c, - all:slot1_mb_dimma2_temp_c, - all:slot1_mb_dimma3_temp_c, - all:slot1_mb_dimma4_temp_c, - all:slot1_mb_dimma5_temp_c, - all:slot1_mb_dimma6_temp_c, - all:slot1_mb_dimma7_temp_c])), - linear_nic(all:nic_nic_temp_c) + pid_nic(all:nic_nic_temp_c), - linear_boot_drive(all:slot1_mb_ssd0_temp_c) + - pid_boot_drive(all:slot1_mb_ssd0_temp_c), - linear_e1s_temp( - max([ - all:slot1_1ou_e1s_ssd0_temp_c, - all:slot1_1ou_e1s_ssd1_temp_c, - all:slot1_1ou_e1s_ssd2_temp_c, - all:slot1_2ou_e1s_ssd0_temp_c, - all:slot1_2ou_e1s_ssd1_temp_c, - all:slot1_2ou_e1s_ssd2_temp_c, - all:slot1_2ou_e1s_ssd3_temp_c, - all:slot1_2ou_e1s_ssd4_temp_c])) + - pid_e1s_temp( - max([ - all:slot1_1ou_e1s_ssd0_temp_c, - all:slot1_1ou_e1s_ssd1_temp_c, - all:slot1_1ou_e1s_ssd2_temp_c, - all:slot1_2ou_e1s_ssd0_temp_c, - all:slot1_2ou_e1s_ssd1_temp_c, - all:slot1_2ou_e1s_ssd2_temp_c, - all:slot1_2ou_e1s_ssd3_temp_c, - all:slot1_2ou_e1s_ssd4_temp_c])), - linear_non_fru_sensor( - max([ - all:slot1_mb_hsc_temp_c, - all:slot1_mb_vr_vccin_temp_c, - all:slot1_mb_vr_ehv_temp_c, - all:slot1_mb_vr_fivra_temp_c, - all:slot1_mb_vr_vccinf_temp_c, - all:slot1_mb_vr_vccd0_temp_c, - all:slot1_mb_vr_vccd1_temp_c, - all:slot1_1ou_bic_temp_c, - all:slot1_1ou_retimer_temp_c, - all:slot1_2ou_bic_temp_c, - all:slot1_3ou_bic_temp_c, - all:slot1_4ou_bic_temp_c, - all:bmc_bb_hsc_temp_c])) -]) diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/setup-fan.sh b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/setup-fan.sh index d19b6fb42ab7..747798344292 100644 --- a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/setup-fan.sh +++ b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd/setup-fan.sh @@ -177,10 +177,8 @@ init_class1_fsc() { 8) config_type="8" sys_sku=$(get_system_sku) - if [[ "$sys_sku" == "Cache" ]]; then - target_fsc_config="/etc/FSC_CLASS1_type8_RSC_cache_GL_config.json" - elif [[ "$sys_sku" == "2.1" ]]; then - target_fsc_config="/etc/FSC_CLASS1_type8_2.1_GL_config.json" + if [[ "$sys_sku" == "2.2" ]]; then + target_fsc_config="/etc/FSC_CLASS1_type8_2.2_GL_config.json" else target_fsc_config="/etc/FSC_CLASS1_type8_GL_config.json" fi diff --git a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd_0.3.bbappend b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd_0.3.bbappend index fa2d41db8907..e525fc25243b 100644 --- a/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd_0.3.bbappend +++ b/meta-facebook/meta-fby35/recipes-fby35/fscd/fscd_0.3.bbappend @@ -39,10 +39,8 @@ LOCAL_URI += " \ file://FSC_CLASS1_type8_GL_zone1.fsc \ file://FSC_CLASS1_JI_config.json \ file://FSC_CLASS1_JI_zone1.fsc \ - file://FSC_CLASS1_type8_2.1_GL_config.json \ - file://FSC_CLASS1_type8_2.1_GL_zone1.fsc \ - file://FSC_CLASS1_type8_RSC_cache_GL_config.json \ - file://FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc \ + file://FSC_CLASS1_type8_2.2_GL_config.json \ + file://FSC_CLASS1_type8_2.2_GL_zone1.fsc \ " RDEPENDS:${PN} += "bash" @@ -57,8 +55,7 @@ FSC_CONFIG += "FSC_CLASS1_type1_config.json \ FSC_CLASS1_GL_config.json \ FSC_CLASS1_type8_GL_config.json \ FSC_CLASS1_JI_config.json \ - FSC_CLASS1_type8_2.1_GL_config.json \ - FSC_CLASS1_type8_RSC_cache_GL_config.json \ + FSC_CLASS1_type8_2.2_GL_config.json \ " FSC_ZONE_CONFIG += "FSC_CLASS1_type1_zone1.fsc \ @@ -71,7 +68,6 @@ FSC_ZONE_CONFIG += "FSC_CLASS1_type1_zone1.fsc \ FSC_CLASS1_GL_zone1.fsc \ FSC_CLASS1_type8_GL_zone1.fsc \ FSC_CLASS1_JI_zone1.fsc \ - FSC_CLASS1_type8_2.1_GL_zone1.fsc \ - FSC_CLASS1_type8_RSC_cache_GL_zone1.fsc \ + FSC_CLASS1_type8_2.2_GL_zone1.fsc \ " FSC_INIT_FILE += "setup-fan.sh" diff --git a/meta-facebook/meta-fby35/recipes-fby35/plat-libs/files/pal/pal_sensors.c b/meta-facebook/meta-fby35/recipes-fby35/plat-libs/files/pal/pal_sensors.c index 21dcf01a2b10..8aa885edffda 100644 --- a/meta-facebook/meta-fby35/recipes-fby35/plat-libs/files/pal/pal_sensors.c +++ b/meta-facebook/meta-fby35/recipes-fby35/plat-libs/files/pal/pal_sensors.c @@ -1005,27 +1005,6 @@ const uint8_t bic_op_4ou_skip_sensor_list[] = { BIC_OP_4OU_MAIN_P12V_PWR_W, }; -const uint8_t bic_op_3ou_cache_sensor_list[] = { - BIC_OP_3OU_TEMP_C, - BIC_OP_3OU_P3V3_STBY_ADC_VOLT_V, - BIC_OP_3OU_P1V8_ADC_VOLT_V, - BIC_OP_3OU_P1V2_ADC_VOLT_V, -}; - -const uint8_t bic_op_3ou_cache_skip_sensor_list[] = { -}; - -const uint8_t bic_op_4ou_cache_sensor_list[] = { - BIC_OP_4OU_TEMP_C, - BIC_OP_4OU_P3V3_STBY_ADC_VOLT_V, - BIC_OP_4OU_P1V8_STBY_ADC_VOLT_V, - BIC_OP_4OU_P1V2_STBY_ADC_VOLT_V, -}; - -const uint8_t bic_op_4ou_cache_skip_sensor_list[] = { -}; - - const uint8_t nic_sensor_list[] = { NIC_SENSOR_TEMP, }; @@ -1475,11 +1454,6 @@ size_t bic_op_2ou_skip_sensor_cnt = sizeof(bic_op_2ou_skip_sensor_list)/sizeof(u size_t bic_op_3ou_sensor_cnt = sizeof(bic_op_3ou_sensor_list)/sizeof(uint8_t); size_t bic_op_3ou_skip_sensor_cnt = sizeof(bic_op_3ou_skip_sensor_list)/sizeof(uint8_t); size_t bic_op_4ou_sensor_cnt = sizeof(bic_op_4ou_sensor_list)/sizeof(uint8_t); -size_t bic_op_4ou_skip_sensor_cnt = sizeof(bic_op_4ou_skip_sensor_list)/sizeof(uint8_t); -size_t bic_op_3ou_cache_sensor_cnt = sizeof(bic_op_3ou_cache_sensor_list)/sizeof(uint8_t); -size_t bic_op_3ou_cache_skip_sensor_cnt = sizeof(bic_op_3ou_cache_skip_sensor_list)/sizeof(uint8_t); -size_t bic_op_4ou_cache_sensor_cnt = sizeof(bic_op_4ou_cache_sensor_list)/sizeof(uint8_t); -size_t bic_op_4ou_cache_skip_sensor_cnt = sizeof(bic_op_4ou_cache_skip_sensor_list)/sizeof(uint8_t); static int compare(const void *arg1, const void *arg2) { return(*(int *)arg2 - *(int *)arg1); @@ -1768,16 +1742,6 @@ pal_get_fru_sensor_list(uint8_t fru, uint8_t **sensor_list, int *cnt) { current_cnt += bic_op_1ou_sensor_cnt; memcpy(&bic_dynamic_sensor_list[fru-1][current_cnt], bic_op_2ou_sensor_list, bic_op_2ou_sensor_cnt); current_cnt += bic_op_2ou_sensor_cnt; - char sys_sku[MAX_VALUE_LEN] = {0}; - if (kv_get("system_sku", sys_sku, NULL, 0) == 0) { - if (strcmp(sys_sku, "Cache") == 0) { - memcpy(&bic_dynamic_sensor_list[fru-1][current_cnt], bic_op_3ou_cache_sensor_list, bic_op_3ou_cache_sensor_cnt); - current_cnt += bic_op_3ou_cache_sensor_cnt; - memcpy(&bic_dynamic_sensor_list[fru-1][current_cnt], bic_op_4ou_cache_sensor_list, bic_op_4ou_cache_sensor_cnt); - current_cnt += bic_op_4ou_cache_sensor_cnt; - break; - } - } memcpy(&bic_dynamic_sensor_list[fru-1][current_cnt], bic_op_3ou_sensor_list, bic_op_3ou_sensor_cnt); current_cnt += bic_op_3ou_sensor_cnt; memcpy(&bic_dynamic_sensor_list[fru-1][current_cnt], bic_op_4ou_sensor_list, bic_op_4ou_sensor_cnt); diff --git a/meta-facebook/meta-fby35/recipes-fby35/plat-utils/files/setup-sku.sh b/meta-facebook/meta-fby35/recipes-fby35/plat-utils/files/setup-sku.sh index d567e19e7aeb..05bf0b5e40cd 100644 --- a/meta-facebook/meta-fby35/recipes-fby35/plat-utils/files/setup-sku.sh +++ b/meta-facebook/meta-fby35/recipes-fby35/plat-utils/files/setup-sku.sh @@ -22,97 +22,17 @@ fru_check_list=("bmc" "bb" "slot1" "slot1 1U" "slot1 2U" "slot1 3U" "slot1 4U") -cnt_t8=0 -cnt_bulk=0 -cnt_cache=0 +cnt_t8_0=0 #2.0 +cnt_t8_2=0 #2.2 sku= -function get_sku_nume() { - board_revision=$1 - local data - - case $sku in - "2.1") - data="Olympic 2.1 $board_revision T8" - ;; - "Cache") - data="Olympic 2.0 $board_revision RSC2 CacheStore" - ;; - "2.0") - data="Olympic 2.0 $board_revision T8" - ;; - *) - data="Olympic 2.0 $board_revision T8" - ;; - esac - - echo $data -} - -function get_fru_board_revision() { - echo $6 -} - -function get_fru_name() { - fru="$1 $2" - local data - - case $fru in - "slot1 1U") - data="slot1_dev19" - ;; - "slot1 2U") - data="slot1_dev20" - ;; - "slot1 3U") - data="slot1_dev21" - ;; - "slot1 4U") - data="slot1_dev22" - ;; - *) - data=$fru - ;; - esac - - echo $data -} - -function modify_fru() -{ - for fru in "${fru_check_list[@]}"; do - pn=$(/usr/local/bin/fruid-util $fru | grep 'Product Name') - board_revision=$(get_fru_board_revision $pn) - sku_name=$(get_sku_nume $board_revision) - fru_name=$(get_fru_name $fru) - - if [[ "$pn" =~ "$fru_name" ]]; then - continue - else - /usr/local/bin/fruid-util $fru --modify --PN "$sku_name" /tmp/fruid_"$fru_name".bin > /dev/null 2>&1 - /usr/local/bin/fruid-util $fru --write /tmp/fruid_"$fru_name".bin > /dev/null 2>&1 - fi - done -} - function determine_sku() { - if [[ $cnt_bulk -gt $cnt_cache ]]; then - max=$cnt_bulk - sku="2.1" - else - max=$cnt_cache - sku="Cache" - fi - - if [[ $cnt_t8 -gt $max ]]; then + if [[ $cnt_t8_0 -gt $cnt_t8_2 ]]; then sku="2.0" - fi - - # Disable exp 3ou and 4ou normal power - if [[ $sku -eq "Cache" ]]; then - /usr/sbin/i2cset -y 4 0x0f 0x19 0x02 >/dev/null + else + sku="2.2" fi kv set system_sku "$sku" @@ -127,17 +47,14 @@ function check_fru_product_name() { return fi - if [[ $pn =~ "2.1" ]]; then - cnt_bulk=$(($cnt_bulk+1)) - elif [[ $pn =~ "CacheStore" ]]; then - cnt_cache=$(($cnt_cache+1)) + if [[ $pn =~ "2.2" ]]; then + cnt_t8_2=$(($cnt_t8_2+1)) else - cnt_t8=$(($cnt_t8+1)) + cnt_t8_0=$(($cnt_t8_0+1)) fi done determine_sku - modify_fru } function setup_system_sku() {