From 12ec8bd51e81a025a444585359f019f49b57a702 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 23 May 2019 14:47:43 +0100 Subject: arm: Rename hw/arm/arm.h to hw/arm/boot.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header file hw/arm/arm.h now includes only declarations relating to hw/arm/boot.c functionality. Rename it accordingly, and adjust its header comment. The bulk of this commit was created via perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h In a few cases we can just delete the #include: hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and include/hw/arm/bcm2836.h did not require it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-id: 20190516163857.6430-4-peter.maydell@linaro.org --- hw/arm/armsse.c | 2 +- hw/arm/armv7m.c | 2 +- hw/arm/aspeed.c | 2 +- hw/arm/boot.c | 2 +- hw/arm/collie.c | 2 +- hw/arm/exynos4210.c | 2 +- hw/arm/exynos4_boards.c | 2 +- hw/arm/highbank.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/mainstone.c | 2 +- hw/arm/microbit.c | 2 +- hw/arm/mps2-tz.c | 2 +- hw/arm/mps2.c | 2 +- hw/arm/msf2-soc.c | 1 - hw/arm/msf2-som.c | 2 +- hw/arm/musca.c | 2 +- hw/arm/musicpal.c | 2 +- hw/arm/netduino2.c | 2 +- hw/arm/nrf51_soc.c | 2 +- hw/arm/nseries.c | 2 +- hw/arm/omap1.c | 2 +- hw/arm/omap2.c | 2 +- hw/arm/omap_sx1.c | 2 +- hw/arm/palm.c | 2 +- hw/arm/raspi.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/spitz.c | 2 +- hw/arm/stellaris.c | 2 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/tosa.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 2 +- hw/arm/virt.c | 2 +- hw/arm/xilinx_zynq.c | 2 +- hw/arm/xlnx-versal.c | 2 +- hw/arm/z2.c | 2 +- include/hw/arm/allwinner-a10.h | 2 +- include/hw/arm/arm.h | 170 ----------------------------------------- include/hw/arm/aspeed_soc.h | 1 - include/hw/arm/bcm2836.h | 1 - include/hw/arm/boot.h | 170 +++++++++++++++++++++++++++++++++++++++++ include/hw/arm/fsl-imx25.h | 2 +- include/hw/arm/fsl-imx31.h | 2 +- include/hw/arm/fsl-imx6.h | 2 +- include/hw/arm/fsl-imx6ul.h | 2 +- include/hw/arm/fsl-imx7.h | 2 +- include/hw/arm/virt.h | 2 +- include/hw/arm/xlnx-versal.h | 2 +- include/hw/arm/xlnx-zynqmp.h | 2 +- 50 files changed, 215 insertions(+), 218 deletions(-) delete mode 100644 include/hw/arm/arm.h create mode 100644 include/hw/arm/boot.h diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 76cc690..83b9203 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -17,7 +17,7 @@ #include "hw/sysbus.h" #include "hw/registerfields.h" #include "hw/arm/armsse.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" /* Format of the System Information block SYS_CONFIG register */ typedef enum SysConfigFormat { diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index c4b2a9a..0295722 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -13,7 +13,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/loader.h" #include "elf.h" #include "sysemu/qtest.h" diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 29d225e..415cff7 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -14,7 +14,7 @@ #include "qemu-common.h" #include "cpu.h" #include "exec/address-spaces.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/boards.h" diff --git a/hw/arm/boot.c b/hw/arm/boot.c index a830655..7279185 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -12,7 +12,7 @@ #include "qapi/error.h" #include #include "hw/hw.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/linux-boot-if.h" #include "sysemu/kvm.h" #include "sysemu/sysemu.h" diff --git a/hw/arm/collie.c b/hw/arm/collie.c index d12604c..3db3c56 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -14,7 +14,7 @@ #include "hw/sysbus.h" #include "hw/boards.h" #include "strongarm.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/block/flash.h" #include "exec/address-spaces.h" #include "cpu.h" diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index af82e95..0bf6113 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -30,7 +30,7 @@ #include "hw/boards.h" #include "sysemu/sysemu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/loader.h" #include "hw/arm/exynos4210.h" #include "hw/sd/sdhci.h" diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index ea8100f..71f0af3 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -29,7 +29,7 @@ #include "sysemu/sysemu.h" #include "hw/sysbus.h" #include "net/net.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "exec/address-spaces.h" #include "hw/arm/exynos4210.h" #include "hw/net/lan9118.h" diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 96ccf18..a89a1d3 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/loader.h" #include "net/net.h" #include "sysemu/kvm.h" diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 0b6f244..d18caab 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -13,7 +13,7 @@ #include "cpu.h" #include "hw/sysbus.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/misc/arm_integrator_debug.h" #include "hw/net/smc91c111.h" #include "net/net.h" diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index c1cec59..cd1f904 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -16,7 +16,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "net/net.h" #include "hw/net/smc91c111.h" #include "hw/boards.h" diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index da67bf6..e9a891f 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h" diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 7832408..c167a5f 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -40,7 +40,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/armv7m.h" #include "hw/or-irq.h" #include "hw/boards.h" diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 54b7395..b74f137 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/armv7m.h" #include "hw/or-irq.h" #include "hw/boards.h" diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 2702e90..d700b21 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -26,7 +26,6 @@ #include "qemu/units.h" #include "qapi/error.h" #include "qemu-common.h" -#include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "hw/char/serial.h" #include "hw/boards.h" diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index 2432b5e..8c550a8 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -27,7 +27,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "exec/address-spaces.h" #include "hw/arm/msf2-soc.h" #include "cpu.h" diff --git a/hw/arm/musca.c b/hw/arm/musca.c index 23aff43..825d80e 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -24,7 +24,7 @@ #include "qapi/error.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/armsse.h" #include "hw/boards.h" #include "hw/char/pl011.h" diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 93ec3c5..5645997 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -14,7 +14,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c index f936017..f57fc38 100644 --- a/hw/arm/netduino2.c +++ b/hw/arm/netduino2.c @@ -27,7 +27,7 @@ #include "hw/boards.h" #include "qemu/error-report.h" #include "hw/arm/stm32f205_soc.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" static void netduino2_init(MachineState *machine) { diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 3e633d1..ce618ed 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/sysbus.h" #include "hw/boards.h" #include "hw/misc/unimp.h" diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 303f7a3..4a79f5c 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -25,7 +25,7 @@ #include "qemu/bswap.h" #include "sysemu/sysemu.h" #include "hw/arm/omap.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/irq.h" #include "ui/console.h" #include "hw/boards.h" diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 539d29e..28fbe27 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -24,7 +24,7 @@ #include "cpu.h" #include "hw/boards.h" #include "hw/hw.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/omap.h" #include "sysemu/sysemu.h" #include "hw/arm/soc_dma.h" diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 4462239..23e72db 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -26,7 +26,7 @@ #include "sysemu/qtest.h" #include "hw/boards.h" #include "hw/hw.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/omap.h" #include "sysemu/sysemu.h" #include "qemu/timer.h" diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 95a4fe7..cae78d0 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -31,7 +31,7 @@ #include "ui/console.h" #include "hw/arm/omap.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/block/flash.h" #include "sysemu/qtest.h" #include "exec/address-spaces.h" diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 139d27d..9eb9612b 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -25,7 +25,7 @@ #include "ui/console.h" #include "hw/arm/omap.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/input/tsc2xxx.h" #include "hw/loader.h" #include "exec/address-spaces.h" diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index fe2bb51..2b5fe10 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -20,7 +20,7 @@ #include "qemu/error-report.h" #include "hw/boards.h" #include "hw/loader.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "sysemu/sysemu.h" #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 05a244d..d42a76e 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -12,7 +12,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/primecell.h" #include "hw/net/lan9118.h" #include "hw/net/smc91c111.h" diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 22f5958..723cf5d 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -14,7 +14,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "sysemu/sysemu.h" #include "hw/pcmcia.h" #include "hw/i2c/i2c.h" diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 5059aed..499035f 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -11,7 +11,7 @@ #include "qapi/error.h" #include "hw/sysbus.h" #include "hw/ssi/ssi.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "qemu/timer.h" #include "hw/i2c/i2c.h" #include "net/net.h" diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c index 980e5af..a5b6f7b 100644 --- a/hw/arm/stm32f205_soc.c +++ b/hw/arm/stm32f205_soc.c @@ -25,7 +25,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "exec/address-spaces.h" #include "hw/arm/stm32f205_soc.h" diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 644a9c4..a1ecbdd 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -33,7 +33,7 @@ #include "hw/sysbus.h" #include "strongarm.h" #include "qemu/error-report.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "chardev/char-fe.h" #include "chardev/char-serial.h" #include "sysemu/sysemu.h" diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 9a12477..7843d68 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -15,7 +15,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/sharpsl.h" #include "hw/pcmcia.h" #include "hw/boards.h" diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 25166e1..f471fb7 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -12,7 +12,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/net/smc91c111.h" #include "net/net.h" #include "sysemu/sysemu.h" diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index d8634f3..2b3b0c2 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -26,7 +26,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/primecell.h" #include "hw/net/lan9118.h" #include "hw/i2c/i2c.h" diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5331ab7..bf54f10 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -33,7 +33,7 @@ #include "qemu/option.h" #include "qapi/error.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/arm/primecell.h" #include "hw/arm/virt.h" #include "hw/block/flash.h" diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index b3b8215..198e3f9 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -20,7 +20,7 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "net/net.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h" diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 5ee58c0..e8e4278 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -17,7 +17,7 @@ #include "net/net.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "kvm_arm.h" #include "hw/misc/unimp.h" #include "hw/intc/arm_gicv3_common.h" diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 1f906ef..44aa748 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/arm/pxa.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/i2c/i2c.h" #include "hw/ssi/ssi.h" #include "hw/boards.h" diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index 389e128..6305b9c 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -3,7 +3,7 @@ #include "qemu-common.h" #include "qemu/error-report.h" #include "hw/char/serial.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/timer/allwinner-a10-pit.h" #include "hw/intc/allwinner-a10-pic.h" #include "hw/net/allwinner_emac.h" diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h deleted file mode 100644 index ba3a9b4..0000000 --- a/include/hw/arm/arm.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Misc ARM declarations - * - * Copyright (c) 2006 CodeSourcery. - * Written by Paul Brook - * - * This code is licensed under the LGPL. - * - */ - -#ifndef HW_ARM_H -#define HW_ARM_H - -#include "exec/memory.h" -#include "target/arm/cpu-qom.h" -#include "hw/irq.h" -#include "qemu/notify.h" - -typedef enum { - ARM_ENDIANNESS_UNKNOWN = 0, - ARM_ENDIANNESS_LE, - ARM_ENDIANNESS_BE8, - ARM_ENDIANNESS_BE32, -} arm_endianness; - -/** - * armv7m_load_kernel: - * @cpu: CPU - * @kernel_filename: file to load - * @mem_size: mem_size: maximum image size to load - * - * Load the guest image for an ARMv7M system. This must be called by - * any ARMv7M board. (This is necessary to ensure that the CPU resets - * correctly on system reset, as well as for kernel loading.) - */ -void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size); - -/* arm_boot.c */ -struct arm_boot_info { - uint64_t ram_size; - const char *kernel_filename; - const char *kernel_cmdline; - const char *initrd_filename; - const char *dtb_filename; - hwaddr loader_start; - hwaddr dtb_start; - hwaddr dtb_limit; - /* If set to True, arm_load_kernel() will not load DTB. - * It allows board to load DTB manually later. - * (default: False) - */ - bool skip_dtb_autoload; - /* multicore boards that use the default secondary core boot functions - * need to put the address of the secondary boot code, the boot reg, - * and the GIC address in the next 3 values, respectively. boards that - * have their own boot functions can use these values as they want. - */ - hwaddr smp_loader_start; - hwaddr smp_bootreg_addr; - hwaddr gic_cpu_if_addr; - int nb_cpus; - int board_id; - /* ARM machines that support the ARM Security Extensions use this field to - * control whether Linux is booted as secure(true) or non-secure(false). - */ - bool secure_boot; - int (*atag_board)(const struct arm_boot_info *info, void *p); - /* multicore boards that use the default secondary core boot functions - * can ignore these two function calls. If the default functions won't - * work, then write_secondary_boot() should write a suitable blob of - * code mimicking the secondary CPU startup process used by the board's - * boot loader/boot ROM code, and secondary_cpu_reset_hook() should - * perform any necessary CPU reset handling and set the PC for the - * secondary CPUs to point at this boot blob. - */ - void (*write_secondary_boot)(ARMCPU *cpu, - const struct arm_boot_info *info); - void (*secondary_cpu_reset_hook)(ARMCPU *cpu, - const struct arm_boot_info *info); - /* if a board is able to create a dtb without a dtb file then it - * sets get_dtb. This will only be used if no dtb file is provided - * by the user. On success, sets *size to the length of the created - * dtb, and returns a pointer to it. (The caller must free this memory - * with g_free() when it has finished with it.) On failure, returns NULL. - */ - void *(*get_dtb)(const struct arm_boot_info *info, int *size); - /* if a board needs to be able to modify a device tree provided by - * the user it should implement this hook. - */ - void (*modify_dtb)(const struct arm_boot_info *info, void *fdt); - /* Used internally by arm_boot.c */ - int is_linux; - hwaddr initrd_start; - hwaddr initrd_size; - hwaddr entry; - - /* Boot firmware has been loaded, typically at address 0, with -bios or - * -pflash. It also implies that fw_cfg_find() will succeed. - */ - bool firmware_loaded; - - /* Address at which board specific loader/setup code exists. If enabled, - * this code-blob will run before anything else. It must return to the - * caller via the link register. There is no stack set up. Enabled by - * defining write_board_setup, which is responsible for loading the blob - * to the specified address. - */ - hwaddr board_setup_addr; - void (*write_board_setup)(ARMCPU *cpu, - const struct arm_boot_info *info); - - /* If set, the board specific loader/setup blob will be run from secure - * mode, regardless of secure_boot. The blob becomes responsible for - * changing to non-secure state if implementing a non-secure boot - */ - bool secure_board_setup; - - arm_endianness endianness; -}; - -/** - * arm_load_kernel - Loads memory with everything needed to boot - * - * @cpu: handle to the first CPU object - * @info: handle to the boot info struct - * Registers a machine init done notifier that copies to memory - * everything needed to boot, depending on machine and user options: - * kernel image, boot loaders, initrd, dtb. Also registers the CPU - * reset handler. - * - * In case the machine file supports the platform bus device and its - * dynamically instantiable sysbus devices, this function must be called - * before sysbus-fdt arm_register_platform_bus_fdt_creator. Indeed the - * machine init done notifiers are called in registration reverse order. - */ -void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info); - -AddressSpace *arm_boot_address_space(ARMCPU *cpu, - const struct arm_boot_info *info); - -/** - * arm_load_dtb() - load a device tree binary image into memory - * @addr: the address to load the image at - * @binfo: struct describing the boot environment - * @addr_limit: upper limit of the available memory area at @addr - * @as: address space to load image to - * - * Load a device tree supplied by the machine or by the user with the - * '-dtb' command line option, and put it at offset @addr in target - * memory. - * - * If @addr_limit contains a meaningful value (i.e., it is strictly greater - * than @addr), the device tree is only loaded if its size does not exceed - * the limit. - * - * Returns: the size of the device tree image on success, - * 0 if the image size exceeds the limit, - * -1 on errors. - * - * Note: Must not be called unless have_dtb(binfo) is true. - */ -int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, - hwaddr addr_limit, AddressSpace *as); - -/* Write a secure board setup routine with a dummy handler for SMCs */ -void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, - const struct arm_boot_info *info, - hwaddr mvbar_addr); - -#endif /* HW_ARM_H */ diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 11ec017..836b2ba 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -12,7 +12,6 @@ #ifndef ASPEED_SOC_H #define ASPEED_SOC_H -#include "hw/arm/arm.h" #include "hw/intc/aspeed_vic.h" #include "hw/misc/aspeed_scu.h" #include "hw/misc/aspeed_sdmc.h" diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 9324839..a2cb845 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -11,7 +11,6 @@ #ifndef BCM2836_H #define BCM2836_H -#include "hw/arm/arm.h" #include "hw/arm/bcm2835_peripherals.h" #include "hw/intc/bcm2836_control.h" diff --git a/include/hw/arm/boot.h b/include/hw/arm/boot.h new file mode 100644 index 0000000..c48cc4c --- /dev/null +++ b/include/hw/arm/boot.h @@ -0,0 +1,170 @@ +/* + * ARM kernel loader. + * + * Copyright (c) 2006 CodeSourcery. + * Written by Paul Brook + * + * This code is licensed under the LGPL. + * + */ + +#ifndef HW_ARM_BOOT_H +#define HW_ARM_BOOT_H + +#include "exec/memory.h" +#include "target/arm/cpu-qom.h" +#include "hw/irq.h" +#include "qemu/notify.h" + +typedef enum { + ARM_ENDIANNESS_UNKNOWN = 0, + ARM_ENDIANNESS_LE, + ARM_ENDIANNESS_BE8, + ARM_ENDIANNESS_BE32, +} arm_endianness; + +/** + * armv7m_load_kernel: + * @cpu: CPU + * @kernel_filename: file to load + * @mem_size: mem_size: maximum image size to load + * + * Load the guest image for an ARMv7M system. This must be called by + * any ARMv7M board. (This is necessary to ensure that the CPU resets + * correctly on system reset, as well as for kernel loading.) + */ +void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size); + +/* arm_boot.c */ +struct arm_boot_info { + uint64_t ram_size; + const char *kernel_filename; + const char *kernel_cmdline; + const char *initrd_filename; + const char *dtb_filename; + hwaddr loader_start; + hwaddr dtb_start; + hwaddr dtb_limit; + /* If set to True, arm_load_kernel() will not load DTB. + * It allows board to load DTB manually later. + * (default: False) + */ + bool skip_dtb_autoload; + /* multicore boards that use the default secondary core boot functions + * need to put the address of the secondary boot code, the boot reg, + * and the GIC address in the next 3 values, respectively. boards that + * have their own boot functions can use these values as they want. + */ + hwaddr smp_loader_start; + hwaddr smp_bootreg_addr; + hwaddr gic_cpu_if_addr; + int nb_cpus; + int board_id; + /* ARM machines that support the ARM Security Extensions use this field to + * control whether Linux is booted as secure(true) or non-secure(false). + */ + bool secure_boot; + int (*atag_board)(const struct arm_boot_info *info, void *p); + /* multicore boards that use the default secondary core boot functions + * can ignore these two function calls. If the default functions won't + * work, then write_secondary_boot() should write a suitable blob of + * code mimicking the secondary CPU startup process used by the board's + * boot loader/boot ROM code, and secondary_cpu_reset_hook() should + * perform any necessary CPU reset handling and set the PC for the + * secondary CPUs to point at this boot blob. + */ + void (*write_secondary_boot)(ARMCPU *cpu, + const struct arm_boot_info *info); + void (*secondary_cpu_reset_hook)(ARMCPU *cpu, + const struct arm_boot_info *info); + /* if a board is able to create a dtb without a dtb file then it + * sets get_dtb. This will only be used if no dtb file is provided + * by the user. On success, sets *size to the length of the created + * dtb, and returns a pointer to it. (The caller must free this memory + * with g_free() when it has finished with it.) On failure, returns NULL. + */ + void *(*get_dtb)(const struct arm_boot_info *info, int *size); + /* if a board needs to be able to modify a device tree provided by + * the user it should implement this hook. + */ + void (*modify_dtb)(const struct arm_boot_info *info, void *fdt); + /* Used internally by arm_boot.c */ + int is_linux; + hwaddr initrd_start; + hwaddr initrd_size; + hwaddr entry; + + /* Boot firmware has been loaded, typically at address 0, with -bios or + * -pflash. It also implies that fw_cfg_find() will succeed. + */ + bool firmware_loaded; + + /* Address at which board specific loader/setup code exists. If enabled, + * this code-blob will run before anything else. It must return to the + * caller via the link register. There is no stack set up. Enabled by + * defining write_board_setup, which is responsible for loading the blob + * to the specified address. + */ + hwaddr board_setup_addr; + void (*write_board_setup)(ARMCPU *cpu, + const struct arm_boot_info *info); + + /* If set, the board specific loader/setup blob will be run from secure + * mode, regardless of secure_boot. The blob becomes responsible for + * changing to non-secure state if implementing a non-secure boot + */ + bool secure_board_setup; + + arm_endianness endianness; +}; + +/** + * arm_load_kernel - Loads memory with everything needed to boot + * + * @cpu: handle to the first CPU object + * @info: handle to the boot info struct + * Registers a machine init done notifier that copies to memory + * everything needed to boot, depending on machine and user options: + * kernel image, boot loaders, initrd, dtb. Also registers the CPU + * reset handler. + * + * In case the machine file supports the platform bus device and its + * dynamically instantiable sysbus devices, this function must be called + * before sysbus-fdt arm_register_platform_bus_fdt_creator. Indeed the + * machine init done notifiers are called in registration reverse order. + */ +void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info); + +AddressSpace *arm_boot_address_space(ARMCPU *cpu, + const struct arm_boot_info *info); + +/** + * arm_load_dtb() - load a device tree binary image into memory + * @addr: the address to load the image at + * @binfo: struct describing the boot environment + * @addr_limit: upper limit of the available memory area at @addr + * @as: address space to load image to + * + * Load a device tree supplied by the machine or by the user with the + * '-dtb' command line option, and put it at offset @addr in target + * memory. + * + * If @addr_limit contains a meaningful value (i.e., it is strictly greater + * than @addr), the device tree is only loaded if its size does not exceed + * the limit. + * + * Returns: the size of the device tree image on success, + * 0 if the image size exceeds the limit, + * -1 on errors. + * + * Note: Must not be called unless have_dtb(binfo) is true. + */ +int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, + hwaddr addr_limit, AddressSpace *as); + +/* Write a secure board setup routine with a dummy handler for SMCs */ +void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, + const struct arm_boot_info *info, + hwaddr mvbar_addr); + +#endif /* HW_ARM_BOOT_H */ diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 65a7371..3280ab1 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -17,7 +17,7 @@ #ifndef FSL_IMX25_H #define FSL_IMX25_H -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/intc/imx_avic.h" #include "hw/misc/imx25_ccm.h" #include "hw/char/imx_serial.h" diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h index d408abb..e68a81e 100644 --- a/include/hw/arm/fsl-imx31.h +++ b/include/hw/arm/fsl-imx31.h @@ -17,7 +17,7 @@ #ifndef FSL_IMX31_H #define FSL_IMX31_H -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/intc/imx_avic.h" #include "hw/misc/imx31_ccm.h" #include "hw/char/imx_serial.h" diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index 06f8aae..1265a55 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -17,7 +17,7 @@ #ifndef FSL_IMX6_H #define FSL_IMX6_H -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/cpu/a9mpcore.h" #include "hw/misc/imx6_ccm.h" #include "hw/misc/imx6_src.h" diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index 5897217..9e94e98 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -17,7 +17,7 @@ #ifndef FSL_IMX6UL_H #define FSL_IMX6UL_H -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/cpu/a15mpcore.h" #include "hw/misc/imx6ul_ccm.h" #include "hw/misc/imx6_src.h" diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index d848262..4101f80 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -19,7 +19,7 @@ #ifndef FSL_IMX7_H #define FSL_IMX7_H -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/cpu/a15mpcore.h" #include "hw/intc/imx_gpcv2.h" #include "hw/misc/imx7_ccm.h" diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 4240709..73005f0 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -34,7 +34,7 @@ #include "exec/hwaddr.h" #include "qemu/notify.h" #include "hw/boards.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/block/flash.h" #include "sysemu/kvm.h" #include "hw/intc/arm_gicv3_common.h" diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index ec7c859..14405c1 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -13,7 +13,7 @@ #define XLNX_VERSAL_H #include "hw/sysbus.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/intc/arm_gicv3.h" #define TYPE_XLNX_VERSAL "xlnx-versal" diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 591515c..cd90b04 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -18,7 +18,7 @@ #ifndef XLNX_ZYNQMP_H #include "qemu-common.h" -#include "hw/arm/arm.h" +#include "hw/arm/boot.h" #include "hw/intc/arm_gic.h" #include "hw/net/cadence_gem.h" #include "hw/char/cadence_uart.h" -- cgit v1.1