blobutil: support downloading E6400 VGA ROM
For Nvidia GPU models of Dell Latitude E6400fsdg20230625
parent
0729d6e600
commit
5a197b4ff1
|
@ -1,5 +1,6 @@
|
||||||
*~
|
*~
|
||||||
*.o
|
*.o
|
||||||
|
/pciroms/
|
||||||
/util/e6400-flash-unlock/e6400_flash_unlock
|
/util/e6400-flash-unlock/e6400_flash_unlock
|
||||||
/util/ich9utils/*.bin
|
/util/ich9utils/*.bin
|
||||||
/util/ich9utils/demefactory
|
/util/ich9utils/demefactory
|
||||||
|
|
|
@ -48,3 +48,13 @@
|
||||||
EC_url https://ftp.hp.com/pub/softpaq/sp96001-96500/sp96090.exe
|
EC_url https://ftp.hp.com/pub/softpaq/sp96001-96500/sp96090.exe
|
||||||
EC_url_bkup http://web.archive.org/web/20220504072602/https://ftp.ext.hp.com/pub/softpaq/sp96001-96500/sp96090.exe
|
EC_url_bkup http://web.archive.org/web/20220504072602/https://ftp.ext.hp.com/pub/softpaq/sp96001-96500/sp96090.exe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# nvidia vga option rom for dgpu models of Dell Latitude E6400
|
||||||
|
# for downloading the nvidia rom to pciroms/pci0x10de,0x06eb.rom
|
||||||
|
{e6400nvidia}{
|
||||||
|
E6400_VGA_DL_hash a24ed919e80287b281e407d525af31f307746250
|
||||||
|
E6400_VGA_DL_url https://dl.dell.com/FOLDER01530530M/1/E6400A34.exe
|
||||||
|
E6400_VGA_DL_url_bkup https://web.archive.org/web/20230506014903/https://dl.dell.com/FOLDER01530530M/1/E6400A34.exe
|
||||||
|
E6400_VGA_offset 274451
|
||||||
|
E6400_VGA_romname mod_21.bin
|
||||||
|
}
|
||||||
|
|
|
@ -9,11 +9,18 @@ ec_url=""
|
||||||
ec_url_bkup=""
|
ec_url_bkup=""
|
||||||
ec_hash=""
|
ec_hash=""
|
||||||
|
|
||||||
|
e6400_vga_dl_hash=""
|
||||||
|
e6400_vga_dl_url=""
|
||||||
|
e6400_vga_dl_url_bkup=""
|
||||||
|
e6400_vga_offset=""
|
||||||
|
e6400_vga_romname=""
|
||||||
|
|
||||||
blobdir="blobs"
|
blobdir="blobs"
|
||||||
dl_path="${blobdir}/vendorupdate"
|
dl_path="${blobdir}/vendorupdate"
|
||||||
appdir="${blobdir}/app"
|
appdir="${blobdir}/app"
|
||||||
_7ztest="a"
|
_7ztest="a"
|
||||||
mecleaner="$(pwd)/me_cleaner/me_cleaner.py"
|
mecleaner="$(pwd)/me_cleaner/me_cleaner.py"
|
||||||
|
e6400_unpack="$(pwd)/bios_extract/dell_inspiron_1100_unpacker.py"
|
||||||
me7updateparser="$(pwd)/resources/blobs/me7_update_parser.py"
|
me7updateparser="$(pwd)/resources/blobs/me7_update_parser.py"
|
||||||
kbc1126_ec_dump="$(pwd)/coreboot/default/util/kbc1126/kbc1126_ec_dump"
|
kbc1126_ec_dump="$(pwd)/coreboot/default/util/kbc1126/kbc1126_ec_dump"
|
||||||
board="${1}"
|
board="${1}"
|
||||||
|
@ -49,6 +56,12 @@ if [ "${CONFIG_KBC1126_FIRMWARE}" = "y" ]; then
|
||||||
needs="${needs} EC"
|
needs="${needs} EC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${CONFIG_BOARD_DELL_E6400}" = "y" ] \
|
||||||
|
&& [ "${CONFIG_VGA_BIOS_FILE}" != "" ]; then
|
||||||
|
printf "Dell E6400 with Nvidia GPU detected, downloading VGA ROM\n"
|
||||||
|
needs="${needs} E6400VGA"
|
||||||
|
fi
|
||||||
|
|
||||||
# Quickly exit without wasting more time if there are no blobs needed (GM45)
|
# Quickly exit without wasting more time if there are no blobs needed (GM45)
|
||||||
if [ -z ${needs+x} ]; then
|
if [ -z ${needs+x} ]; then
|
||||||
printf 'No binary blobs needed for this board\n'
|
printf 'No binary blobs needed for this board\n'
|
||||||
|
@ -81,6 +94,26 @@ while read -r line ; do
|
||||||
set ${line}
|
set ${line}
|
||||||
dl_url_bkup=${2}
|
dl_url_bkup=${2}
|
||||||
;;
|
;;
|
||||||
|
E6400_VGA_DL_hash*)
|
||||||
|
set ${line}
|
||||||
|
e6400_vga_dl_hash=${2}
|
||||||
|
;;
|
||||||
|
E6400_VGA_DL_url*)
|
||||||
|
set ${line}
|
||||||
|
e6400_vga_dl_url=${2}
|
||||||
|
;;
|
||||||
|
E6400_VGA_DL_url_bkup*)
|
||||||
|
set ${line}
|
||||||
|
e6400_vga_dl_url_bkup=${2}
|
||||||
|
;;
|
||||||
|
E6400_VGA_offset*)
|
||||||
|
set ${line}
|
||||||
|
e6400_vga_offset=${2}
|
||||||
|
;;
|
||||||
|
E6400_VGA_romname*)
|
||||||
|
set ${line}
|
||||||
|
e6400_vga_romname=${2}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done << EOF
|
done << EOF
|
||||||
$(eval "awk ' /\{.*${board_short}.*}{/ {flag=1;next} /\}/{flag=0} flag { print }' resources/blobs/sources")
|
$(eval "awk ' /\{.*${board_short}.*}{/ {flag=1;next} /\}/{flag=0} flag { print }' resources/blobs/sources")
|
||||||
|
@ -107,6 +140,11 @@ Build_deps(){
|
||||||
./download coreboot default || Fail 'could not download coreboot'
|
./download coreboot default || Fail 'could not download coreboot'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d bios_extract ]; then
|
||||||
|
printf "downloading bios_extract\n"
|
||||||
|
./download bios_extract || Fail 'could not download bios_extract'
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f coreboot/default/util/kbc1126/kbc1126_ec_dump ]; then
|
if [ ! -f coreboot/default/util/kbc1126/kbc1126_ec_dump ]; then
|
||||||
printf "Building kbc1126_ec_dump from coreboot\n"
|
printf "Building kbc1126_ec_dump from coreboot\n"
|
||||||
make -BC coreboot/default/util/kbc1126 || Fail \
|
make -BC coreboot/default/util/kbc1126 || Fail \
|
||||||
|
@ -131,6 +169,9 @@ Download_needed(){
|
||||||
*EC*)
|
*EC*)
|
||||||
Download_ec || _failed="${_failed} ec"
|
Download_ec || _failed="${_failed} ec"
|
||||||
;;
|
;;
|
||||||
|
*E6400VGA*)
|
||||||
|
Download_e6400vga || _failed="${_failed} e6400vga"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -286,6 +327,62 @@ Extract_ec() {
|
||||||
cp "${appdir}/${dl_path##*/}"/ec.bin.fw* "${_ec_destination%/*}/"
|
cp "${appdir}/${dl_path##*/}"/ec.bin.fw* "${_ec_destination%/*}/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Download_e6400vga() {
|
||||||
|
printf "Downloading Nvidia VGA ROM for Dell Latitude E6400\n"
|
||||||
|
|
||||||
|
Fetch_update e6400vga || return 1
|
||||||
|
Extract_e6400vga || return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Extract_e6400vga() {
|
||||||
|
printf "Extracting Nvidia VGA ROM for ${board}\n"
|
||||||
|
|
||||||
|
_vga_destination=${CONFIG_VGA_BIOS_FILE#../../}
|
||||||
|
|
||||||
|
if [ -f "${_vga_destination}" ]; then
|
||||||
|
printf 'vga rom already downloaded\n'
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${_vga_destination%/*}" ]; then
|
||||||
|
mkdir -p ${_vga_destination%/*}
|
||||||
|
fi
|
||||||
|
if [ -d "${appdir}" ]; then
|
||||||
|
rm -r ${appdir}
|
||||||
|
fi
|
||||||
|
mkdir -p "${appdir}"
|
||||||
|
mv "${dl_path}" "${appdir}"
|
||||||
|
|
||||||
|
if [ "${e6400_vga_offset}" = "" ]; then
|
||||||
|
printf "E6400 VGA offset not defined\n"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ "${e6400_vga_romname}" = "" ]; then
|
||||||
|
printf "E6400 VGA ROM name not defined\n"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "${appdir}"
|
||||||
|
tail -c +${e6400_vga_offset} "${dl_path##*/}" \
|
||||||
|
| gunzip > bios.bin
|
||||||
|
if [ ! -f "bios.bin" ]; then
|
||||||
|
Fail 'Could not extract bios.bin from Dell E6400 update'
|
||||||
|
fi
|
||||||
|
"${e6400_unpack}" bios.bin || printf "TODO: fix dell extract util\n"
|
||||||
|
if [ ! -f "${e6400_vga_romname}" ]; then
|
||||||
|
Fail 'Could not extract VGA ROM from Dell E6400 BIOS update'
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
|
cp "${appdir}"/"${e6400_vga_romname}" "${_vga_destination}"
|
||||||
|
|
||||||
|
printf "E6400 Nvidia ROM saved to: %s\n" "${_vga_destination}"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
Fetch_update() {
|
Fetch_update() {
|
||||||
printf "Fetching vendor update for board: %s\n" ${board}
|
printf "Fetching vendor update for board: %s\n" ${board}
|
||||||
|
|
||||||
|
@ -301,18 +398,22 @@ Fetch_update() {
|
||||||
dl=${ec_url}
|
dl=${ec_url}
|
||||||
dl_bkup=${ec_url_bkup}
|
dl_bkup=${ec_url_bkup}
|
||||||
dlsum=${ec_hash}
|
dlsum=${ec_hash}
|
||||||
|
elif [ "${fw_type}" = "e6400vga" ]; then
|
||||||
|
dl=${e6400_vga_dl_url}
|
||||||
|
dl_bkup=${e6400_vga_dl_url_bkup}
|
||||||
|
dlsum=${e6400_vga_dl_hash}
|
||||||
else
|
else
|
||||||
printf "Unsupported download type: %s\n" ${fw_type}
|
printf "Unsupported download type: %s\n" ${fw_type}
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${dl_url+x}" ]; then
|
if [ -z "${dl_url+x}" ] && [ "${fw_type}" != "e6400vga" ]; then
|
||||||
printf "No vendor update specified for board: %s\n" ${board}
|
printf "No vendor update specified for board: %s\n" ${board}
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Vendor_checksum ${dlsum} || \
|
Vendor_checksum ${dlsum} || \
|
||||||
curl ${dl} > ${dl_path} || curl ${dl_bkup} > ${dl_path}
|
wget ${dl} -O ${dl_path} || wget ${dl_bkup} -O ${dl_path}
|
||||||
|
|
||||||
Vendor_checksum ${dlsum} || Fail \
|
Vendor_checksum ${dlsum} || Fail \
|
||||||
"Cannot guarantee intergity of vendor update for board: ${board}"
|
"Cannot guarantee intergity of vendor update for board: ${board}"
|
||||||
|
@ -329,7 +430,7 @@ Vendor_checksum() {
|
||||||
fi
|
fi
|
||||||
if [ "$(sha1sum ${dl_path} | awk '{print $1}')" != "${sha1}" ]; then
|
if [ "$(sha1sum ${dl_path} | awk '{print $1}')" != "${sha1}" ]; then
|
||||||
printf "Bad checksum on vendor update for board: %s\n" ${board}
|
printf "Bad checksum on vendor update for board: %s\n" ${board}
|
||||||
rm ${dl_path}
|
# rm ${dl_path}
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
|
|
|
@ -121,6 +121,26 @@ set -- "resources/coreboot/${board}/config/*"
|
||||||
./coreboot/default/util/cbfstool/cbfstool "${rom}" add -f ${_ec2_location} -n ecfw2.bin -b ${_ec2_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
|
fi
|
||||||
|
|
||||||
|
if [ "${CONFIG_VGA_BIOS_FILE}" != "" ] \
|
||||||
|
&& [ "${CONFIG_VGA_BIOS_ID}" != "" ]; then
|
||||||
|
_vga_location="${CONFIG_VGA_BIOS_FILE#../../}"
|
||||||
|
_vga_dir="${_vga_location%/*}"
|
||||||
|
_vga_filename="${_vga_location##*/}"
|
||||||
|
printf "adding pci option rom\n"
|
||||||
|
if [ "${_vga_dir}" != "pciroms" ]; then
|
||||||
|
printf "Invalid PCI ROM directory: %s\n" ${_vga_dir}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -f "${_vga_location}" ]; then
|
||||||
|
printf "No such file exists: %s\n" ${_vga_location}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
./coreboot/default/util/cbfstool/cbfstool ${rom} \
|
||||||
|
add -f "${_vga_location}" \
|
||||||
|
-n "pci${CONFIG_VGA_BIOS_ID}.rom" \
|
||||||
|
-t optionrom || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${modifygbe}" = "true" ] && ! [ "${release}" = "true" ]; then
|
if [ "${modifygbe}" = "true" ] && ! [ "${release}" = "true" ]; then
|
||||||
Modify_gbe ${rom}
|
Modify_gbe ${rom}
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -66,8 +66,9 @@ for romdir in bin/*; do
|
||||||
grep "CONFIG_HAVE_ME_BIN=y" "resources/coreboot/${target}/config/"* || CONFIG_HAVE_ME_BIN="n"
|
grep "CONFIG_HAVE_ME_BIN=y" "resources/coreboot/${target}/config/"* || CONFIG_HAVE_ME_BIN="n"
|
||||||
grep "CONFIG_HAVE_MRC=y" "resources/coreboot/${target}/config/"* || CONFIG_HAVE_MRC="n"
|
grep "CONFIG_HAVE_MRC=y" "resources/coreboot/${target}/config/"* || CONFIG_HAVE_MRC="n"
|
||||||
grep "CONFIG_KBC1126_FIRMWARE=y" "resources/coreboot/${target}/config"/* || CONFIG_KBC1126_FIRMWARE="n"
|
grep "CONFIG_KBC1126_FIRMWARE=y" "resources/coreboot/${target}/config"/* || CONFIG_KBC1126_FIRMWARE="n"
|
||||||
|
|
||||||
# remove ME/MRC/EC firmware from ROM images
|
# remove ME/MRC/EC firmware from ROM images
|
||||||
if [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then
|
if [ "${CONFIG_HAVE_ME_BIN}" = "y" ] || [ "${target}" = "e6400nvidia_4mb" ]; then
|
||||||
if [ ! -d coreboot/default ]; then
|
if [ ! -d coreboot/default ]; then
|
||||||
./download coreboot default || exit 1
|
./download coreboot default || exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -99,14 +100,15 @@ for romdir in bin/*; do
|
||||||
|
|
||||||
for romfile in "${romdir}"/*.rom
|
for romfile in "${romdir}"/*.rom
|
||||||
do
|
do
|
||||||
if [ ! -f "${romfile}" ]
|
if [ ! -f "${romfile}" ]; then
|
||||||
then
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${ifdtool} --nuke me "${romfile}" || exit 1
|
if [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then
|
||||||
mv "${romfile}" "${romdir}_tmp"/
|
${ifdtool} --nuke me "${romfile}" || exit 1
|
||||||
mv "${romfile}.new" "${romfile}"
|
mv "${romfile}" "${romdir}_tmp"/
|
||||||
|
mv "${romfile}.new" "${romfile}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${CONFIG_HAVE_MRC}" = "y" ]
|
if [ "${CONFIG_HAVE_MRC}" = "y" ]
|
||||||
then
|
then
|
||||||
|
@ -118,6 +120,13 @@ for romdir in bin/*; do
|
||||||
${cbfstool} "${romfile}" remove -n ecfw1.bin || exit 1
|
${cbfstool} "${romfile}" remove -n ecfw1.bin || exit 1
|
||||||
${cbfstool} "${romfile}" remove -n ecfw2.bin || exit 1
|
${cbfstool} "${romfile}" remove -n ecfw2.bin || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO: replace this board-specific hack
|
||||||
|
if [ "${target}" = "e6400nvidia_4mb" ]; then
|
||||||
|
${cbfstool} "${romfile}" remove \
|
||||||
|
-n "pci10de,06eb.rom" \
|
||||||
|
|| exit 1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue