target_arm: Remove memory region init from armv7m_init
[qemu/ar7.git] / include / hw / arm / arm.h
blobf8b329bb3a4b308d7695b4e2d06afcb80c2c9345
1 /*
2 * Misc ARM declarations
4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licensed under the LGPL.
9 */
11 #ifndef ARM_MISC_H
12 #define ARM_MISC_H 1
14 #include "exec/memory.h"
15 #include "hw/irq.h"
17 /* armv7m.c */
18 qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size,
19 const char *kernel_filename, const char *cpu_model);
21 /* arm_boot.c */
22 struct arm_boot_info {
23 uint64_t ram_size;
24 const char *kernel_filename;
25 const char *kernel_cmdline;
26 const char *initrd_filename;
27 const char *dtb_filename;
28 hwaddr loader_start;
29 /* multicore boards that use the default secondary core boot functions
30 * need to put the address of the secondary boot code, the boot reg,
31 * and the GIC address in the next 3 values, respectively. boards that
32 * have their own boot functions can use these values as they want.
34 hwaddr smp_loader_start;
35 hwaddr smp_bootreg_addr;
36 hwaddr gic_cpu_if_addr;
37 int nb_cpus;
38 int board_id;
39 /* ARM machines that support the ARM Security Extensions use this field to
40 * control whether Linux is booted as secure(true) or non-secure(false).
42 bool secure_boot;
43 int (*atag_board)(const struct arm_boot_info *info, void *p);
44 /* multicore boards that use the default secondary core boot functions
45 * can ignore these two function calls. If the default functions won't
46 * work, then write_secondary_boot() should write a suitable blob of
47 * code mimicking the secondary CPU startup process used by the board's
48 * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
49 * perform any necessary CPU reset handling and set the PC for the
50 * secondary CPUs to point at this boot blob.
52 void (*write_secondary_boot)(ARMCPU *cpu,
53 const struct arm_boot_info *info);
54 void (*secondary_cpu_reset_hook)(ARMCPU *cpu,
55 const struct arm_boot_info *info);
56 /* if a board is able to create a dtb without a dtb file then it
57 * sets get_dtb. This will only be used if no dtb file is provided
58 * by the user. On success, sets *size to the length of the created
59 * dtb, and returns a pointer to it. (The caller must free this memory
60 * with g_free() when it has finished with it.) On failure, returns NULL.
62 void *(*get_dtb)(const struct arm_boot_info *info, int *size);
63 /* if a board needs to be able to modify a device tree provided by
64 * the user it should implement this hook.
66 void (*modify_dtb)(const struct arm_boot_info *info, void *fdt);
67 /* Used internally by arm_boot.c */
68 int is_linux;
69 hwaddr initrd_start;
70 hwaddr initrd_size;
71 hwaddr entry;
73 /* Boot firmware has been loaded, typically at address 0, with -bios or
74 * -pflash. It also implies that fw_cfg_find() will succeed.
76 bool firmware_loaded;
78 void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
80 /* Multiplication factor to convert from system clock ticks to qemu timer
81 ticks. */
82 extern int system_clock_scale;
84 #endif /* !ARM_MISC_H */