6b5bc77c9b
Stefan thinks they don't add value. Command used: sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool) The exceptions are for: - crossgcc (patch file) - gcov (imported from gcc) - elf.h (imported from GNU's libc) - nvramtool (more complicated header) The removed lines are: - fmt.Fprintln(f, "/* This file is part of the coreboot project. */") -# This file is part of a set of unofficial pre-commit hooks available -/* This file is part of coreboot */ -# This file is part of msrtool. -/* This file is part of msrtool. */ - * This file is part of ncurses, designed to be appended after curses.h.in -/* This file is part of pgtblgen. */ - * This file is part of the coreboot project. - /* This file is part of the coreboot project. */ -# This file is part of the coreboot project. -# This file is part of the coreboot project. -## This file is part of the coreboot project. --- This file is part of the coreboot project. -/* This file is part of the coreboot project */ -/* This file is part of the coreboot project. */ -;## This file is part of the coreboot project. -# This file is part of the coreboot project. It originated in the - * This file is part of the coreinfo project. -## This file is part of the coreinfo project. - * This file is part of the depthcharge project. -/* This file is part of the depthcharge project. */ -/* This file is part of the ectool project. */ - * This file is part of the GNU C Library. - * This file is part of the libpayload project. -## This file is part of the libpayload project. -/* This file is part of the Linux kernel. */ -## This file is part of the superiotool project. -/* This file is part of the superiotool project */ -/* This file is part of uio_usbdebug */ Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
83 lines
1.6 KiB
C
83 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <acpi/acpi.h>
|
|
#include <cbmem.h>
|
|
#include <console/console.h>
|
|
#include <console/streams.h>
|
|
#include <cpu/x86/tsc.h>
|
|
#include <program_loading.h>
|
|
#include <rmodule.h>
|
|
#include <stage_cache.h>
|
|
|
|
#include <soc/ramstage.h>
|
|
#include <soc/efi_wrapper.h>
|
|
|
|
static void ABI_X86 send_to_console(unsigned char b)
|
|
{
|
|
console_tx_byte(b);
|
|
}
|
|
|
|
static efi_wrapper_entry_t load_refcode_from_cache(void)
|
|
{
|
|
struct prog refcode;
|
|
|
|
printk(BIOS_DEBUG, "refcode loading from cache.\n");
|
|
|
|
stage_cache_load_stage(STAGE_REFCODE, &refcode);
|
|
|
|
return (efi_wrapper_entry_t)prog_entry(&refcode);
|
|
}
|
|
|
|
static efi_wrapper_entry_t load_reference_code(void)
|
|
{
|
|
struct prog prog =
|
|
PROG_INIT(PROG_REFCODE, CONFIG_CBFS_PREFIX "/refcode");
|
|
struct rmod_stage_load refcode = {
|
|
.cbmem_id = CBMEM_ID_REFCODE,
|
|
.prog = &prog,
|
|
};
|
|
|
|
if (acpi_is_wakeup_s3()) {
|
|
return load_refcode_from_cache();
|
|
}
|
|
|
|
if (prog_locate(&prog)) {
|
|
printk(BIOS_DEBUG, "Couldn't locate reference code.\n");
|
|
return NULL;
|
|
}
|
|
|
|
if (rmodule_stage_load(&refcode)) {
|
|
printk(BIOS_DEBUG, "Error loading reference code.\n");
|
|
return NULL;
|
|
}
|
|
|
|
/* Cache loaded reference code. */
|
|
stage_cache_add(STAGE_REFCODE, &prog);
|
|
|
|
return prog_entry(&prog);
|
|
}
|
|
|
|
void baytrail_run_reference_code(void)
|
|
{
|
|
int ret;
|
|
efi_wrapper_entry_t entry;
|
|
struct efi_wrapper_params wrp = {
|
|
.version = EFI_WRAPPER_VER,
|
|
.console_out = send_to_console,
|
|
};
|
|
|
|
entry = load_reference_code();
|
|
|
|
if (entry == NULL)
|
|
return;
|
|
|
|
wrp.tsc_ticks_per_microsecond = tsc_freq_mhz();
|
|
|
|
/* Call into reference code. */
|
|
ret = entry(&wrp);
|
|
|
|
if (ret != 0) {
|
|
printk(BIOS_DEBUG, "Reference code returned %d\n", ret);
|
|
return;
|
|
}
|
|
}
|