From eb267733fabe6c773720706539ef37f1ce591f81 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Fri, 13 Oct 2023 22:41:15 +0300 Subject: build/fw/coreboot: Fix misuse of raw u-boot.bin as payload The "u-boot.bin" file generated by U-Boot builds is a raw binary. When adding payloads to a CBFS, we need to use ELF files with add-payload or manually pass the entry point and load address of the payload binary with add-flat-binary. We primarily use the "u-boot.elf" which gets build with the REMAKE_ELF option, as it also has the necessary device-tree binary that U-Boot usually needs to work. When the option is not set (e.g. for QEMU), we need to use the "u-boot" file which is an ELF. Signed-off-by: Alper Nebi Yasak --- script/build/fw/coreboot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/build/fw/coreboot b/script/build/fw/coreboot index 934d6ffd..487bfa31 100755 --- a/script/build/fw/coreboot +++ b/script/build/fw/coreboot @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2014-2016,2020,2021,2023 Leah Rowe # SPDX-FileCopyrightText: 2021,2022 Ferass El Hafidi # SPDX-FileCopyrightText: 2022 Caleb La Grange -# SPDX-FileCopyrightText: 2022 Alper Nebi Yasak +# SPDX-FileCopyrightText: 2022-2023 Alper Nebi Yasak # SPDX-FileCopyrightText: 2023 Riku Viitanen [ "x${DEBUG+set}" = 'xset' ] && set -v @@ -187,8 +187,8 @@ build_dependency_uboot() x_ ./update project trees -b u-boot ${board} ubdir="elf/u-boot/${board}/${uboot_config}" ubootelf="${ubdir}/u-boot.elf" - [ ! -f "${ubootelf}" ] && [ -f "${ubdir}/u-boot.bin" ] && \ - ubootelf="${ubdir}/u-boot.bin" + [ ! -f "${ubootelf}" ] && [ -f "${ubdir}/u-boot" ] && \ + ubootelf="${ubdir}/u-boot" [ -f "${ubootelf}" ] && return 0 err "Could not find u-boot build for board, ${board}" } @@ -369,7 +369,7 @@ mkUbootRom() { _ubdir="elf/u-boot/${board}/${uboot_config}" _ubootelf="${_ubdir}/u-boot.elf" - [ -f "${_ubootelf}" ] || _ubootelf="${_ubdir}/u-boot.bin" + [ -f "${_ubootelf}" ] || _ubootelf="${_ubdir}/u-boot" [ -f "${_ubootelf}" ] || err "mkUbootRom: ${board}: cant find u-boot" tmprom=$(mktemp -t coreboot_rom.XXXXXXXXXX) -- cgit v1.2.1 From b2d84213dae4e199b4e4fa4f70dd6e3fbf5d90c4 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Fri, 13 Oct 2023 11:16:41 +0300 Subject: update/project/trees: Add flags for more kconfig actions Add an "-s" flag for "make savedefconfig", "-l" for "make olddefconfig" and "-n" for "make nconfig" to the update script. The first two are mainly useful for U-Boot, to compare our configs to the upstream defconfigs and stay in sync with any upstream changes. The latter is because the ncurses one has a nice "Symbol Search" that can point out the menu entry for a config symbol we know. Signed-off-by: Alper Nebi Yasak --- script/update/project/trees | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/update/project/trees b/script/update/project/trees index 6a31d8d0..9e6803cf 100755 --- a/script/update/project/trees +++ b/script/update/project/trees @@ -1,6 +1,6 @@ #!/usr/bin/env sh # SPDX-License-Identifier: GPL-3.0-or-later -# SPDX-FileCopyrightText: 2022 Alper Nebi Yasak +# SPDX-FileCopyrightText: 2022-2023 Alper Nebi Yasak # SPDX-FileCopyrightText: 2022 Ferass El Hafidi # SPDX-FileCopyrightText: 2023 Leah Rowe @@ -21,7 +21,7 @@ tmpclean="$(mktemp -d -t makeclean.XXXXXXXXXX)" main() { - while getopts f:b:m:u:c:x: option + while getopts f:b:m:u:c:x:s:l:n: option do _f="${1}" case "${1}" in @@ -31,11 +31,14 @@ main() -c) mode="distclean" ;; -x) mode="crossgcc-clean" ;; -f) mode="fetch" ;; + -s) mode="savedefconfig" ;; + -l) mode="olddefconfig" ;; + -n) mode="nconfig" ;; *) err "Invalid option" ;; esac shift; project="${OPTARG#src/}"; shift done - [ -z "${_f}" ] && err "flag not specified (-m, -u, -b, -c or -x)" + [ -z "${_f}" ] && err "flag not specified (-m, -u, -b, -c, -x, -f, -s, -l or -n)" [ -z "${project}" ] && err "project name not specified" if [ ! -f "config/${project}/build.list" ]; then @@ -263,8 +266,11 @@ handle_makefile() if [ -e "${codedir}/.git" ] && [ "${project}" = "u-boot" ] && \ [ "${mode}" = "distclean" ]; then x_ git -C "${codedir}" clean -fdx - elif [ "${mode}" = "oldconfig" ] || [ "${mode}" = "menuconfig" ]; then + elif [ "${mode}" = "oldconfig" ] || [ "${mode}" = "olddefconfig" ] || \ + [ "${mode}" = "menuconfig" ] || [ "${mode}" = "nconfig" ]; then x_ cp "${codedir}/.config" "${config}" + elif [ "${mode}" = "savedefconfig" ]; then + x_ cp "${codedir}/defconfig" "${config}" fi } -- cgit v1.2.1 From 4d9567a7561df6eeb0dd81f2faf522c8526163b0 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Sat, 14 Oct 2023 17:08:59 +0300 Subject: coreboot: gru: Use default coreboot tree We don't really need a custom coreboot tree for Chromebooks. I had added one, because at a cursory glance to the available config/coreboot/board subdirectories I had the impression that I should. But upstreams have one tree for every board and I think we should move towards that too. Move the one important BL31 makefile patch into the default coreboot patches, update the gru boards' configs by running savedefconfig in the cros tree and then running olddefconfig in the default tree. Signed-off-by: Alper Nebi Yasak --- script/update/project/trees | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'script') diff --git a/script/update/project/trees b/script/update/project/trees index 9e6803cf..bb0899f0 100755 --- a/script/update/project/trees +++ b/script/update/project/trees @@ -196,9 +196,7 @@ check_cross_compiler() cbdir="src/coreboot/${tree}" [ "${project}" != "coreboot" ] && \ - cbdir="src/coreboot/default" # not u-boot (e.g. linux) - [ "${project}" = "u-boot" ] && \ - cbdir="src/coreboot/cros" # u-boot only used on coreboot/cros + cbdir="src/coreboot/default" # only true if not building coreboot: ctarget="${cbdir#src/coreboot/}" -- cgit v1.2.1