Statistics
| Branch: | Revision:

root / hw / arm-misc.h @ d8c6d07f

History | View | Annotate | Download (2.3 kB)

1 87ecb68b pbrook
/*
2 87ecb68b pbrook
 * Misc ARM declarations
3 87ecb68b pbrook
 *
4 87ecb68b pbrook
 * Copyright (c) 2006 CodeSourcery.
5 87ecb68b pbrook
 * Written by Paul Brook
6 87ecb68b pbrook
 *
7 8e31bf38 Matthew Fernandez
 * This code is licensed under the LGPL.
8 87ecb68b pbrook
 *
9 87ecb68b pbrook
 */
10 87ecb68b pbrook
11 87ecb68b pbrook
#ifndef ARM_MISC_H
12 87ecb68b pbrook
#define ARM_MISC_H 1
13 87ecb68b pbrook
14 022c62cb Paolo Bonzini
#include "exec/memory.h"
15 5202ef94 Igor Mammedov
#include "hw/irq.h"
16 7d6f78cf Avi Kivity
17 87ecb68b pbrook
/* The CPU is also modeled as an interrupt controller.  */
18 87ecb68b pbrook
#define ARM_PIC_CPU_IRQ 0
19 87ecb68b pbrook
#define ARM_PIC_CPU_FIQ 1
20 4bd74661 Andreas Färber
qemu_irq *arm_pic_init_cpu(ARMCPU *cpu);
21 87ecb68b pbrook
22 87ecb68b pbrook
/* armv7m.c */
23 7d6f78cf Avi Kivity
qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
24 7d6f78cf Avi Kivity
                      int flash_size, int sram_size,
25 87ecb68b pbrook
                      const char *kernel_filename, const char *cpu_model);
26 87ecb68b pbrook
27 87ecb68b pbrook
/* arm_boot.c */
28 f93eb9ff balrog
struct arm_boot_info {
29 de841dea Peter Maydell
    uint64_t ram_size;
30 f93eb9ff balrog
    const char *kernel_filename;
31 f93eb9ff balrog
    const char *kernel_cmdline;
32 f93eb9ff balrog
    const char *initrd_filename;
33 412beee6 Grant Likely
    const char *dtb_filename;
34 a8170e5e Avi Kivity
    hwaddr loader_start;
35 9d5ba9bf Mark Langsdorf
    /* multicore boards that use the default secondary core boot functions
36 9d5ba9bf Mark Langsdorf
     * need to put the address of the secondary boot code, the boot reg,
37 9d5ba9bf Mark Langsdorf
     * and the GIC address in the next 3 values, respectively. boards that
38 9d5ba9bf Mark Langsdorf
     * have their own boot functions can use these values as they want.
39 9d5ba9bf Mark Langsdorf
     */
40 a8170e5e Avi Kivity
    hwaddr smp_loader_start;
41 a8170e5e Avi Kivity
    hwaddr smp_bootreg_addr;
42 a8170e5e Avi Kivity
    hwaddr gic_cpu_if_addr;
43 f93eb9ff balrog
    int nb_cpus;
44 f93eb9ff balrog
    int board_id;
45 462a8bc6 Stefan Weil
    int (*atag_board)(const struct arm_boot_info *info, void *p);
46 9d5ba9bf Mark Langsdorf
    /* multicore boards that use the default secondary core boot functions
47 9d5ba9bf Mark Langsdorf
     * can ignore these two function calls. If the default functions won't
48 9d5ba9bf Mark Langsdorf
     * work, then write_secondary_boot() should write a suitable blob of
49 9b574c29 Andreas Färber
     * code mimicking the secondary CPU startup process used by the board's
50 9d5ba9bf Mark Langsdorf
     * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
51 9b574c29 Andreas Färber
     * perform any necessary CPU reset handling and set the PC for the
52 9d5ba9bf Mark Langsdorf
     * secondary CPUs to point at this boot blob.
53 9d5ba9bf Mark Langsdorf
     */
54 9543b0cd Andreas Färber
    void (*write_secondary_boot)(ARMCPU *cpu,
55 9d5ba9bf Mark Langsdorf
                                 const struct arm_boot_info *info);
56 5d309320 Andreas Färber
    void (*secondary_cpu_reset_hook)(ARMCPU *cpu,
57 9d5ba9bf Mark Langsdorf
                                     const struct arm_boot_info *info);
58 f2d74978 Paul Brook
    /* Used internally by arm_boot.c */
59 f2d74978 Paul Brook
    int is_linux;
60 fc53b7d4 Peter Maydell
    hwaddr initrd_start;
61 a8170e5e Avi Kivity
    hwaddr initrd_size;
62 a8170e5e Avi Kivity
    hwaddr entry;
63 f93eb9ff balrog
};
64 3aaa8dfa Andreas Färber
void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
65 87ecb68b pbrook
66 79383c9c blueswir1
/* Multiplication factor to convert from system clock ticks to qemu timer
67 79383c9c blueswir1
   ticks.  */
68 7ee930d0 blueswir1
extern int system_clock_scale;
69 87ecb68b pbrook
70 87ecb68b pbrook
#endif /* !ARM_MISC_H */