Skip to content

Commit

Permalink
hw-mgmt: scripts: bobcat sn4280 changes.
Browse files Browse the repository at this point in the history
Fix SMBIOS BOM VR on AMD Comex.
Remove duplication of DPU number config.
Rename unclear dpu sysfs attribute.
Code beatification (tab alignment).

Signed-off-by: Michael Shych <[email protected]>
  • Loading branch information
mshych committed Jan 16, 2024
1 parent 463edfd commit 0889f39
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
74 changes: 37 additions & 37 deletions usr/usr/bin/hw-management-devtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ declare -A comex_bf3_alternatives=(["mp2975_0"]="mp2975 0x6b 15 comex_voltmon1"
["24c512_0"]="24c512 0x50 16 cpu_info")

declare -A comex_amd_snw_alternatives=(["mp2855_0"]="mp2855 0x69 15 comex_voltmon1" \
["mp2855_0"]="mp2855 0x6a 15 comex_voltmon2" \
["mp2855_1"]="mp2855 0x6a 15 comex_voltmon2" \
["24c512_0"]="24c512 0x50 16 cpu_info")

declare -A mqm8700_alternatives=(["max11603_0"]="max11603 0x64 5 swb_a2d" \
Expand Down Expand Up @@ -497,7 +497,7 @@ devtr_check_supported_system_init_alternatives()
# ;;
VMOD0009)
case $sku in
HI117)
HI117)
for key in "${!msn27002_alternatives[@]}"; do
swb_alternatives["$key"]="${msn27002_alternatives["$key"]}"
done
Expand Down Expand Up @@ -536,43 +536,43 @@ devtr_check_supported_system_init_alternatives()
;;
VMOD0017)
case $sku in
HI152)
for key in "${!p4262_alternatives[@]}"; do
swb_alternatives["$key"]="${p4262_alternatives["$key"]}"
done
for key in "${!pwr_type1_alternatives[@]}"; do
pwr_alternatives["$key"]="${pwr_type1_alternatives["$key"]}"
done
;;
HI159)
for key in "${!p4300_alternatives[@]}"; do
swb_alternatives["$key"]="${p4300_alternatives["$key"]}"
done
for key in "${!pwr_type2_alternatives[@]}"; do
pwr_alternatives["$key"]="${pwr_type2_alternatives["$key"]}"
done
HI152)
for key in "${!p4262_alternatives[@]}"; do
swb_alternatives["$key"]="${p4262_alternatives["$key"]}"
done
for key in "${!pwr_type1_alternatives[@]}"; do
pwr_alternatives["$key"]="${pwr_type1_alternatives["$key"]}"
done
;;
HI159)
for key in "${!p4300_alternatives[@]}"; do
swb_alternatives["$key"]="${p4300_alternatives["$key"]}"
done
for key in "${!pwr_type2_alternatives[@]}"; do
pwr_alternatives["$key"]="${pwr_type2_alternatives["$key"]}"
done
;;
esac
return 0
;;
VMOD0018)
case $sku in
HI157)
for key in "${!qm3400_alternatives[@]}"; do
swb_alternatives["$key"]="${qm3400_alternatives["$key"]}"
done
HI157)
for key in "${!qm3400_alternatives[@]}"; do
swb_alternatives["$key"]="${qm3400_alternatives["$key"]}"
done
;;
HI158)
for key in "${!qm3000_alternatives[@]}"; do
swb_alternatives["$key"]="${qm3000_alternatives["$key"]}"
done
for key in "${!platform_type1_alternatives[@]}"; do
platform_alternatives["$key"]="${platform_type1_alternatives["$key"]}"
done
HI158)
for key in "${!qm3000_alternatives[@]}"; do
swb_alternatives["$key"]="${qm3000_alternatives["$key"]}"
done
for key in "${!platform_type1_alternatives[@]}"; do
platform_alternatives["$key"]="${platform_type1_alternatives["$key"]}"
done
;;
*)
log_info "SMBIOS BOM info: unsupported board_type: ${board_type}, sku ${sku}"
return 1
*)
log_info "SMBIOS BOM info: unsupported board_type: ${board_type}, sku ${sku}"
return 1
;;
esac
for key in "${!fan_type1_alternatives[@]}"; do
Expand All @@ -585,10 +585,10 @@ devtr_check_supported_system_init_alternatives()
;;
VMOD0019)
case $sku in
HI160)
for key in "${!sn4280_alternatives[@]}"; do
swb_alternatives["$key"]="${sn4280_alternatives["$key"]}"
done
HI160)
for key in "${!sn4280_alternatives[@]}"; do
swb_alternatives["$key"]="${sn4280_alternatives["$key"]}"
done
;;
*)
log_info "SMBIOS BOM info: unsupported board_type: ${board_type}, sku ${sku}"
Expand Down Expand Up @@ -686,8 +686,8 @@ devtr_check_board_components()
;;
D) # DPU board
# There are several DPU boards (SN4280)
if [ -e "$config_path"/dpu_brd_num ]; then
board_num=$(< $config_path/dpu_brd_num)
if [ -e "$config_path"/dpu_num ]; then
board_num=$(< $config_path/dpu_num)
board_name_pfx=dpu
fi
if [ -e "$config_path"/dpu_brd_bus_offset ]; then
Expand Down
2 changes: 1 addition & 1 deletion usr/usr/bin/hw-management-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ board_type_file=/sys/devices/virtual/dmi/id/board_name
sku_file=/sys/devices/virtual/dmi/id/product_sku
system_ver_file=/sys/devices/virtual/dmi/id/product_version
devtree_file=$config_path/devtree
dpu2host_events_file=$config_path/dpu2host_events
dpu2host_events_file=$config_path/dpu_to_host_events
dpu_events_file=$config_path/dpu_events
i2c_bus_def_off_eeprom_cpu_file=$config_path/i2c_bus_def_off_eeprom_cpu
i2c_comex_mon_bus_default_file=$config_path/i2c_comex_mon_bus_default
Expand Down
3 changes: 1 addition & 2 deletions usr/usr/bin/hw-management.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2638,7 +2638,6 @@ set_dpu_pci_id()
echo "$dpu2_pci_bus_id" > "$config_path"/dpu2_pci_bus_id
echo "$dpu3_pci_bus_id" > "$config_path"/dpu3_pci_bus_id
echo "$dpu4_pci_bus_id" > "$config_path"/dpu4_pci_bus_id
echo 4 > "$config_path"/dpu_num
;;
*)
;;
Expand Down Expand Up @@ -2687,7 +2686,7 @@ pre_devtr_init()
VMOD0019)
case $sku in
HI160)
echo 4 > "$config_path"/dpu_brd_num
echo 4 > "$config_path"/dpu_num
echo 1 > "$config_path"/dpu_brd_bus_offset
echo $smart_switch_cpu_bus_offset > $config_path/cpu_brd_bus_offset
;;
Expand Down

0 comments on commit 0889f39

Please sign in to comment.