Linux expects a working PSCI and hangs if not found. Add BL31 into CBFS as '-M virt,secure=on -bios ' commands line arguments cause qemu's internal PSCI emulation to shutdown. BL31 is placed in qemu's SECURERAM memory region and won't conflict with resources in DRAM. Tested on qemu-system-aarch64: Fixes a hang and allows to boot into Linux 5.4.14 userspace. Change-Id: I809742522240185431621cc4fd8b9c7deaf2bb54 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38535 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
32 lines
719 B
C
32 lines
719 B
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright (C) 2019 Asami Doi <d0iasm.pub@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include <cbmem.h>
|
|
#include <ramdetect.h>
|
|
#include <symbols.h>
|
|
#include <device/device.h>
|
|
#include <bootmem.h>
|
|
|
|
extern u8 _secram[], _esecram[];
|
|
|
|
void bootmem_platform_add_ranges(void)
|
|
{
|
|
bootmem_add_range((uintptr_t)_secram, REGION_SIZE(secram), BM_MEM_BL31);
|
|
}
|
|
|
|
static void mainboard_enable(struct device *dev)
|
|
{
|
|
int ram_size_mb = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
|
|
ram_resource(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB);
|
|
}
|
|
|
|
struct chip_operations mainboard_ops = {
|
|
.name = "qemu_aarch64",
|
|
.enable_dev = mainboard_enable,
|
|
};
|