Statistics
| Branch: | Revision:

root / hw / arm-misc.h @ a1e47211

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