spapr: Stop providing RTAS blob
SLOF implements one itself so let's remove it from QEMU. It is one less image and simpler setup as the RTAS blob never stays in its initial place anyway as the guest OS always decides where to put it. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
5ced78955f
commit
744a928cce
@ -1077,8 +1077,6 @@ F: hw/*/spapr*
|
|||||||
F: include/hw/*/spapr*
|
F: include/hw/*/spapr*
|
||||||
F: hw/*/xics*
|
F: hw/*/xics*
|
||||||
F: include/hw/*/xics*
|
F: include/hw/*/xics*
|
||||||
F: pc-bios/spapr-rtas/*
|
|
||||||
F: pc-bios/spapr-rtas.bin
|
|
||||||
F: pc-bios/slof.bin
|
F: pc-bios/slof.bin
|
||||||
F: docs/specs/ppc-spapr-hcalls.txt
|
F: docs/specs/ppc-spapr-hcalls.txt
|
||||||
F: docs/specs/ppc-spapr-hotplug.txt
|
F: docs/specs/ppc-spapr-hotplug.txt
|
||||||
|
2
Makefile
2
Makefile
@ -769,7 +769,7 @@ qemu-nsis.bmp \
|
|||||||
bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
|
bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
|
||||||
multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
|
multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
|
||||||
s390-ccw.img s390-netboot.img \
|
s390-ccw.img s390-netboot.img \
|
||||||
spapr-rtas.bin slof.bin skiboot.lid \
|
slof.bin skiboot.lid \
|
||||||
palcode-clipper \
|
palcode-clipper \
|
||||||
u-boot.e500 u-boot-sam460-20100605.bin \
|
u-boot.e500 u-boot-sam460-20100605.bin \
|
||||||
qemu_vga.ndrv \
|
qemu_vga.ndrv \
|
||||||
|
6
configure
vendored
6
configure
vendored
@ -6166,9 +6166,6 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" ; then
|
|
||||||
roms="$roms spapr-rtas"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
|
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
|
||||||
if test "$cpu" = "s390x" ; then
|
if test "$cpu" = "s390x" ; then
|
||||||
@ -7800,13 +7797,12 @@ fi
|
|||||||
DIRS="tests tests/tcg tests/tcg/lm32 tests/libqos tests/qapi-schema tests/qemu-iotests tests/vm"
|
DIRS="tests tests/tcg tests/tcg/lm32 tests/libqos tests/qapi-schema tests/qemu-iotests tests/vm"
|
||||||
DIRS="$DIRS tests/fp tests/qgraph"
|
DIRS="$DIRS tests/fp tests/qgraph"
|
||||||
DIRS="$DIRS docs docs/interop fsdev scsi"
|
DIRS="$DIRS docs docs/interop fsdev scsi"
|
||||||
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
|
DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
|
||||||
DIRS="$DIRS roms/seabios roms/vgabios"
|
DIRS="$DIRS roms/seabios roms/vgabios"
|
||||||
LINKS="Makefile"
|
LINKS="Makefile"
|
||||||
LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
|
LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
|
||||||
LINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile"
|
LINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile"
|
||||||
LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
|
LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
|
||||||
LINKS="$LINKS pc-bios/spapr-rtas/Makefile"
|
|
||||||
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
|
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
|
||||||
LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile"
|
LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile"
|
||||||
LINKS="$LINKS pc-bios/qemu-icon.bmp"
|
LINKS="$LINKS pc-bios/qemu-icon.bmp"
|
||||||
|
@ -96,7 +96,6 @@
|
|||||||
* We load our kernel at 4M, leaving space for SLOF initial image
|
* We load our kernel at 4M, leaving space for SLOF initial image
|
||||||
*/
|
*/
|
||||||
#define FDT_MAX_SIZE 0x100000
|
#define FDT_MAX_SIZE 0x100000
|
||||||
#define RTAS_MAX_SIZE 0x10000
|
|
||||||
#define RTAS_MAX_ADDR 0x80000000 /* RTAS must stay below that */
|
#define RTAS_MAX_ADDR 0x80000000 /* RTAS must stay below that */
|
||||||
#define FW_MAX_SIZE 0x400000
|
#define FW_MAX_SIZE 0x400000
|
||||||
#define FW_FILE_NAME "slof.bin"
|
#define FW_FILE_NAME "slof.bin"
|
||||||
@ -1723,8 +1722,7 @@ static void spapr_machine_reset(MachineState *machine)
|
|||||||
{
|
{
|
||||||
SpaprMachineState *spapr = SPAPR_MACHINE(machine);
|
SpaprMachineState *spapr = SPAPR_MACHINE(machine);
|
||||||
PowerPCCPU *first_ppc_cpu;
|
PowerPCCPU *first_ppc_cpu;
|
||||||
uint32_t rtas_limit;
|
hwaddr fdt_addr;
|
||||||
hwaddr rtas_addr, fdt_addr;
|
|
||||||
void *fdt;
|
void *fdt;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -1788,14 +1786,10 @@ static void spapr_machine_reset(MachineState *machine)
|
|||||||
* or just below 2GB, whichever is lower, so that it can be
|
* or just below 2GB, whichever is lower, so that it can be
|
||||||
* processed with 32-bit real mode code if necessary
|
* processed with 32-bit real mode code if necessary
|
||||||
*/
|
*/
|
||||||
rtas_limit = MIN(spapr->rma_size, RTAS_MAX_ADDR);
|
fdt_addr = MIN(spapr->rma_size, RTAS_MAX_ADDR) - FDT_MAX_SIZE;
|
||||||
rtas_addr = rtas_limit - RTAS_MAX_SIZE;
|
|
||||||
fdt_addr = rtas_addr - FDT_MAX_SIZE;
|
|
||||||
|
|
||||||
fdt = spapr_build_fdt(spapr);
|
fdt = spapr_build_fdt(spapr);
|
||||||
|
|
||||||
spapr_load_rtas(spapr, fdt, rtas_addr);
|
|
||||||
|
|
||||||
rc = fdt_pack(fdt);
|
rc = fdt_pack(fdt);
|
||||||
|
|
||||||
/* Should only fail if we've built a corrupted tree */
|
/* Should only fail if we've built a corrupted tree */
|
||||||
@ -2955,28 +2949,6 @@ static void spapr_machine_init(MachineState *machine)
|
|||||||
spapr_create_lmb_dr_connectors(spapr);
|
spapr_create_lmb_dr_connectors(spapr);
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "spapr-rtas.bin");
|
|
||||||
if (!filename) {
|
|
||||||
error_report("Could not find LPAR rtas '%s'", "spapr-rtas.bin");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
spapr->rtas_size = get_image_size(filename);
|
|
||||||
if (spapr->rtas_size < 0) {
|
|
||||||
error_report("Could not get size of LPAR rtas '%s'", filename);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
spapr->rtas_blob = g_malloc(spapr->rtas_size);
|
|
||||||
if (load_image_size(filename, spapr->rtas_blob, spapr->rtas_size) < 0) {
|
|
||||||
error_report("Could not load LPAR rtas '%s'", filename);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (spapr->rtas_size > RTAS_MAX_SIZE) {
|
|
||||||
error_report("RTAS too big ! 0x%zx bytes (max is 0x%x)",
|
|
||||||
(size_t)spapr->rtas_size, RTAS_MAX_SIZE);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
g_free(filename);
|
|
||||||
|
|
||||||
/* Set up RTAS event infrastructure */
|
/* Set up RTAS event infrastructure */
|
||||||
spapr_events_init(spapr);
|
spapr_events_init(spapr);
|
||||||
|
|
||||||
|
@ -477,47 +477,6 @@ void spapr_dt_rtas_tokens(void *fdt, int rtas)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr)
|
|
||||||
{
|
|
||||||
int rtas_node;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Copy RTAS blob into guest RAM */
|
|
||||||
cpu_physical_memory_write(addr, spapr->rtas_blob, spapr->rtas_size);
|
|
||||||
|
|
||||||
ret = fdt_add_mem_rsv(fdt, addr, spapr->rtas_size);
|
|
||||||
if (ret < 0) {
|
|
||||||
error_report("Couldn't add RTAS reserve entry: %s",
|
|
||||||
fdt_strerror(ret));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update the device tree with the blob's location */
|
|
||||||
rtas_node = fdt_path_offset(fdt, "/rtas");
|
|
||||||
assert(rtas_node >= 0);
|
|
||||||
|
|
||||||
ret = fdt_setprop_cell(fdt, rtas_node, "linux,rtas-base", addr);
|
|
||||||
if (ret < 0) {
|
|
||||||
error_report("Couldn't add linux,rtas-base property: %s",
|
|
||||||
fdt_strerror(ret));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = fdt_setprop_cell(fdt, rtas_node, "linux,rtas-entry", addr);
|
|
||||||
if (ret < 0) {
|
|
||||||
error_report("Couldn't add linux,rtas-entry property: %s",
|
|
||||||
fdt_strerror(ret));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = fdt_setprop_cell(fdt, rtas_node, "rtas-size", spapr->rtas_size);
|
|
||||||
if (ret < 0) {
|
|
||||||
error_report("Couldn't add rtas-size property: %s",
|
|
||||||
fdt_strerror(ret));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void core_rtas_register_types(void)
|
static void core_rtas_register_types(void)
|
||||||
{
|
{
|
||||||
spapr_rtas_register(RTAS_DISPLAY_CHARACTER, "display-character",
|
spapr_rtas_register(RTAS_DISPLAY_CHARACTER, "display-character",
|
||||||
|
@ -154,8 +154,6 @@ struct SpaprMachineState {
|
|||||||
|
|
||||||
hwaddr rma_size;
|
hwaddr rma_size;
|
||||||
int vrma_adjust;
|
int vrma_adjust;
|
||||||
ssize_t rtas_size;
|
|
||||||
void *rtas_blob;
|
|
||||||
uint32_t fdt_size;
|
uint32_t fdt_size;
|
||||||
uint32_t fdt_initial_size;
|
uint32_t fdt_initial_size;
|
||||||
void *fdt_blob;
|
void *fdt_blob;
|
||||||
|
Binary file not shown.
@ -1,27 +0,0 @@
|
|||||||
all: build-all
|
|
||||||
# Dummy command so that make thinks it has done something
|
|
||||||
@true
|
|
||||||
|
|
||||||
include ../../config-host.mak
|
|
||||||
include $(SRC_PATH)/rules.mak
|
|
||||||
|
|
||||||
$(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas)
|
|
||||||
|
|
||||||
.PHONY : all clean build-all
|
|
||||||
|
|
||||||
#CFLAGS += -I$(SRC_PATH)
|
|
||||||
#QEMU_CFLAGS = $(CFLAGS)
|
|
||||||
|
|
||||||
build-all: spapr-rtas.bin
|
|
||||||
|
|
||||||
%.o: %.S
|
|
||||||
$(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
|
|
||||||
|
|
||||||
%.img: %.o
|
|
||||||
$(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_DIR)$@")
|
|
||||||
|
|
||||||
%.bin: %.img
|
|
||||||
$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TARGET_DIR)$@")
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.d *.img *.bin *~
|
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator
|
|
||||||
*
|
|
||||||
* Trivial in-partition RTAS implementation, based on a hypercall
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010,2011 David Gibson, IBM Corporation.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define KVMPPC_HCALL_BASE 0xf000
|
|
||||||
#define KVMPPC_H_RTAS (KVMPPC_HCALL_BASE + 0x0)
|
|
||||||
|
|
||||||
.globl _start
|
|
||||||
_start:
|
|
||||||
mr 4,3
|
|
||||||
lis 3,KVMPPC_H_RTAS@h
|
|
||||||
ori 3,3,KVMPPC_H_RTAS@l
|
|
||||||
sc 1
|
|
||||||
blr
|
|
Loading…
Reference in New Issue
Block a user