lib/hardwaremain.c: Move creating ACPI structs to bootstate hooks
hardwaremain.c is the common ramstage entry to all platforms so move out ACPI code generation (x86 specific) to boot state hooks. Another reason to do this is the following: On some platforms that start in dram it makes little sense to have separate stages. To reduce the complexity we want to call the ramstage main function instead of loading a full stage. To make this scheme more maintainable it makes sense to move out as much functionality from the 'main' function as possible. Change-Id: I613b927b9a193fc076ffb1b2a40c617965ce2645 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63414 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Kyösti Mälkki
parent
fd016126e4
commit
5cf02a4ecd
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <acpi/acpi_gnvs.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <bootstate.h>
|
||||
#include <cbmem.h>
|
||||
#include <console/console.h>
|
||||
#include <soc/nvs.h>
|
||||
@@ -11,7 +12,7 @@
|
||||
static struct global_nvs *gnvs;
|
||||
static void *dnvs;
|
||||
|
||||
void acpi_create_gnvs(void)
|
||||
static void acpi_create_gnvs(void *unused)
|
||||
{
|
||||
const size_t gnvs_size = ALIGN_UP(sizeof(struct global_nvs), sizeof(uint64_t));
|
||||
const size_t dnvs_size = ALIGN_UP(size_of_dnvs(), sizeof(uint64_t));
|
||||
@@ -34,6 +35,8 @@ void acpi_create_gnvs(void)
|
||||
gnvs->cbmc = (uintptr_t)cbmem_find(CBMEM_ID_CONSOLE);
|
||||
}
|
||||
|
||||
BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, acpi_create_gnvs, NULL);
|
||||
|
||||
void *acpi_get_gnvs(void)
|
||||
{
|
||||
if (gnvs)
|
||||
|
Reference in New Issue
Block a user