blobutil/inject: handle HP KBC1126 EC firmware

fsdg20230625
Leah Rowe 2023-04-23 05:52:16 +01:00
parent 3462afdbcf
commit 46ec14afa8
1 changed files with 28 additions and 0 deletions

View File

@ -2,6 +2,7 @@
# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# SPDX-FileCopyrightText: 2023 Leah Rowe <info@minifree.org>
# SPDX-License-Identifier: GPL-3.0-only
Fail(){
@ -93,6 +94,33 @@ set -- "resources/coreboot/${board}/config/*"
./coreboot/default/util/ifdtool/ifdtool -i me:${_me_location} ${rom} -O ${rom} || exit 1
fi
if [ "${CONFIG_KBC1126_FIRMWARE}" = "y" ]; then
_ec1_location="${CONFIG_KBC1126_FW1#../../}"
_ec1_offset="${CONFIG_KBC1126_FW1_OFFSET}"
_ec2_location="${CONFIG_KBC1126_FW2#../../}"
_ec2_offset="${CONFIG_KBC1126_FW2_OFFSET}"
printf "adding hp kbc1126 ec firmware\n"
if [ "${_ec1_offset}" = "" ] || [ "${_ec1_offset}" = "" ];
then
printf "EC offsets not declared for board: %s\n" \
"${board}"
exit 1
fi
if [ "${_ec1_location}" = "" ] || [ "${_ec2_location}" = "" ];
then
printf "EC firmware path not declared for board: %s\n" \
"${board}"
fi
if [ ! -f "${_ec1_location}" ] || [ ! -f "${_ec2_location}" ];
then
printf "EC firmware not downloaded for board: %s\n" \
"${board}"
exit 1
fi
./coreboot/default/util/cbfstool/cbfstool "${rom}" add -f ${_ec1_location} -n ecfw1.bin -b ${_ec1_offset} -t raw || exit 1
./coreboot/default/util/cbfstool/cbfstool "${rom}" add -f ${_ec2_location} -n ecfw2.bin -b ${_ec2_offset} -t raw || exit 1
fi
if [ "${modifygbe}" = "true" ] && ! [ "${release}" = "true" ]; then
Modify_gbe ${rom}
fi