]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
arm: Rename hw/arm/arm.h to hw/arm/boot.h
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 23 May 2019 13:47:43 +0000 (14:47 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 23 May 2019 13:47:43 +0000 (14:47 +0100)
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 <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190516163857.6430-4-peter.maydell@linaro.org

50 files changed:
hw/arm/armsse.c
hw/arm/armv7m.c
hw/arm/aspeed.c
hw/arm/boot.c
hw/arm/collie.c
hw/arm/exynos4210.c
hw/arm/exynos4_boards.c
hw/arm/highbank.c
hw/arm/integratorcp.c
hw/arm/mainstone.c
hw/arm/microbit.c
hw/arm/mps2-tz.c
hw/arm/mps2.c
hw/arm/msf2-soc.c
hw/arm/msf2-som.c
hw/arm/musca.c
hw/arm/musicpal.c
hw/arm/netduino2.c
hw/arm/nrf51_soc.c
hw/arm/nseries.c
hw/arm/omap1.c
hw/arm/omap2.c
hw/arm/omap_sx1.c
hw/arm/palm.c
hw/arm/raspi.c
hw/arm/realview.c
hw/arm/spitz.c
hw/arm/stellaris.c
hw/arm/stm32f205_soc.c
hw/arm/strongarm.c
hw/arm/tosa.c
hw/arm/versatilepb.c
hw/arm/vexpress.c
hw/arm/virt.c
hw/arm/xilinx_zynq.c
hw/arm/xlnx-versal.c
hw/arm/z2.c
include/hw/arm/allwinner-a10.h
include/hw/arm/arm.h [deleted file]
include/hw/arm/aspeed_soc.h
include/hw/arm/bcm2836.h
include/hw/arm/boot.h [new file with mode: 0644]
include/hw/arm/fsl-imx25.h
include/hw/arm/fsl-imx31.h
include/hw/arm/fsl-imx6.h
include/hw/arm/fsl-imx6ul.h
include/hw/arm/fsl-imx7.h
include/hw/arm/virt.h
include/hw/arm/xlnx-versal.h
include/hw/arm/xlnx-zynqmp.h

index 76cc69057987ebb03cc9bfce36506d75b03bcea4..83b920334d5b6b95c1b7d89bf5f7cd9b16b9104c 100644 (file)
@@ -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 {
index c4b2a9a1f5cabd6f6a7b4255d1d9b4fc110a3b3b..029572258f0d959290b6bdb79229fc32c113b516 100644 (file)
@@ -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"
index 29d225ed1405c1918e3d954fefb2524db1f27851..415cff7a015d0299ffebf4329f5531b9ac50600f 100644 (file)
@@ -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"
index a830655e1afac9ae9b7649ebed5374c5a3324604..7279185bd941d1f2ac9c007490e970ad665b9ced 100644 (file)
@@ -12,7 +12,7 @@
 #include "qapi/error.h"
 #include <libfdt.h>
 #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"
index d12604c5739219e70a21040853ed638ecd4da460..3db3c560048cb83f4a4aaabf395bfb84803ba4d4 100644 (file)
@@ -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"
index af82e955421038c5b745defd0f321bcf3c71510c..0bf611345507d6737eb574855b67d233ee8225b8 100644 (file)
@@ -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"
index ea8100f65a8fa575f8be7a5550d7d93b7e4d15bb..71f0af3bdbbdc465e44f34ca6e7d9b7caa164ef5 100644 (file)
@@ -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"
index 96ccf18d863a280bd4954890c017469b69265018..a89a1d3a7c1dadfaf1a14781ed365dcc4ab5e8ef 100644 (file)
@@ -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"
index 0b6f24465e43fe36dd38c330f31585d49ca662ea..d18caab8bdd48ca5df46da5e4653128dcf6f9889 100644 (file)
@@ -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"
index c1cec5903795d03ed0455bcb0f3c592b182a7246..cd1f904c6c9a0bca87c393104611ba9de2907fe9 100644 (file)
@@ -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"
index da67bf6d9d18663a13c82556809bc6bb5f57f720..e9a891f7d370bdf9b4a50a85af958deddffd9720 100644 (file)
@@ -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"
 
index 7832408bb70dfab1357d857bc45b801b823c7954..c167a5fa5933353e39d62e43d82bb7aeb98b3b04 100644 (file)
@@ -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"
index 54b7395849f3f0f791628a4e943922cc40b88aca..b74f1378c90c35493e33611ef439fff7aa01ad4a 100644 (file)
@@ -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"
index 2702e90b453e5b262a505fe381ead63f63dbc01b..d700b212f8dbb3ecd3dab931574ebea2263bd8fd 100644 (file)
@@ -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"
index 2432b5e9352078625dd456adfe1403e1779c4453..8c550a8bddc1283375129a7aba9013592f6004e9 100644 (file)
@@ -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"
index 23aff43f4bc2be728ac9daa1cded3332ea2d73df..825d80e75a42ab7c5ba4e6ed14664f9adceb0c1b 100644 (file)
@@ -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"
index 93ec3c5698fc59110279aec0df8d7a264bed1784..5645997b56ff5d739b294de0f9da475da1e03b07 100644 (file)
@@ -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"
index f936017d4a7528505ed1da93a9460f63c4f311c0..f57fc38f920ab3de5d8e80b4382d87d724e966ad 100644 (file)
@@ -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)
 {
index 3e633d160ea255f65e223351f1a70ac3c3004c9a..ce618edc7b3c66bca5150bd43f8baa5c75f1ab0c 100644 (file)
@@ -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"
index 303f7a31e1c7a4fdf80d4c72d503437228cfc12f..4a79f5c88b475685a1d379389eed11cdaa7145f9 100644 (file)
@@ -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"
index 539d29ef9ce9075372dd985a42016bd628c8c7f3..28fbe275a88703f943fe0510da86edfa89824357 100644 (file)
@@ -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"
index 446223906e479e638a3148061925588f1b19a163..23e72db79ef49dceb2c6504e9def264a27b26fc3 100644 (file)
@@ -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"
index 95a4fe7e7f0c269d6789e2ca64440ebeb279d553..cae78d0a3685d009dff674f0fc78022850c67a9b 100644 (file)
@@ -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"
index 139d27d1cc01da3b741da537badbf249a3be4841..9eb9612bce9e6d3eab733e0d2d7527191089c01a 100644 (file)
@@ -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"
index fe2bb511b981f5e3a0e8106a3a40bb1c170e98a1..2b5fe10e2f0b7502d56ebbc426d708fd090cef09 100644 (file)
@@ -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 */
index 05a244df255eb636dd9e00eda3bfad6ed37c9c9e..d42a76e7a1cda741ac450dc2e65018416fb14ef8 100644 (file)
@@ -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"
index 22f5958b9dabdfe21b69f060805a6944c8dfd3df..723cf5d5929d5c2392e842bfb5b8733a8692ad2f 100644 (file)
@@ -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"
index 5059aedbaa2daa7f528d508fb8ab5e7fef840fc6..499035f5c8f82d4446ec988900a6b42904ba86c6 100644 (file)
@@ -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"
index 980e5af13c599d22eb689b68959e6f31c0b4eb4f..a5b6f7bda2bb8c8b9c1eb393a80e9fa24408b8c5 100644 (file)
@@ -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"
 
index 644a9c45b4ecb1f3dfaa21c9932ed3b3b58daf12..a1ecbddaab970e4867d03dc3f4f288365e59255c 100644 (file)
@@ -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"
index 9a1247797fefe9f9ecfdc77402d5f5636ad8af30..7843d68d46580d2bce660e20e2505411df999437 100644 (file)
@@ -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"
index 25166e15171091ba8cae17b3cf1563e62148d72f..f471fb70255f5a2700971b817aaab55cd40cde10 100644 (file)
@@ -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"
index d8634f3dd29394824bf5bdab4fa7708f86c1f898..2b3b0c2334e7603149057c54ec09a3d64f8b1f11 100644 (file)
@@ -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"
index 5331ab71e222b6f17708a325cfc767e71890d294..bf54f10b515de1619a885c405b86898898b296bb 100644 (file)
@@ -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"
index b3b82157597c2d6ee115c4e52d3877d3f082b35e..198e3f97634c01c5c7b600dcfa27c853486c47b0 100644 (file)
@@ -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"
index 5ee58c09be88df0bbc8b6abe564a395c85cb3243..e8e4278eb3bf00b620cede644ef309e48a7edf94 100644 (file)
@@ -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"
index 1f906ef20bc95ce386bcdaafc89403d2e1bc80a4..44aa748d39d0cf830faea8e53fede46ca822ddd1 100644 (file)
@@ -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"
index 389e128d0fcd0e1fc3bbad045cc0e9935251b833..6305b9c586f6cf1946213678f2ffc1ff0f6a6a19 100644 (file)
@@ -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 (file)
index ba3a9b4..0000000
+++ /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 */
index 11ec0179db50654f5f0bfd55e137abea49597735..836b2ba8bf159387fb047b3a4b3a87b57d8a5d39 100644 (file)
@@ -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"
index 93248399ba0812f6cc44290e1f02cd57323882c0..a2cb8454dea705dd2ee98fd19096cb28d5d0e536 100644 (file)
@@ -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 (file)
index 0000000..c48cc4c
--- /dev/null
@@ -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 */
index 65a73714efec223270a56fd7e02fb75af2522149..3280ab1fb0585b19f86747fed482f0b64087f668 100644 (file)
@@ -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"
index d408abbba0d3776e51c24ec730a07e100387d80c..e68a81efd750e66a935b8431a00b827352421473 100644 (file)
@@ -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"
index 06f8aaeda421ef3e57f6736b528a667a6f5a2525..1265a55c3b0ab8149e9339f2737a8cd0bfb446a2 100644 (file)
@@ -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"
index 58972171943740a9cc2d2bda4e592c07abc2f765..9e94e98f8ee8c5e717a725cb8764eaa795c884b6 100644 (file)
@@ -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"
index d848262bfdd200706395cfa7cb3bbd8804c0df56..4101f80251e032eefe01563a9c8aea636d2ae50d 100644 (file)
@@ -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"
index 424070924edfafa097acd1b341c308cb5eb57ec7..73005f05ae82ea936a73d439225b510fab9ea51e 100644 (file)
@@ -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"
index ec7c859d08c2f33eb82c3f385dbf1f875da1e25d..14405c1465dbe7355f4f7727d882202a7cdc2036 100644 (file)
@@ -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"
index 591515c7600c4ddcfc52f7ef0b54039851ae33d7..cd90b04310c3243eb0dca8648388b243fad166de 100644 (file)
@@ -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"