2007-11-17 20:14:51 +03:00
|
|
|
/*
|
|
|
|
* Misc ARM declarations
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006 CodeSourcery.
|
|
|
|
* Written by Paul Brook
|
|
|
|
*
|
2011-06-26 06:21:35 +04:00
|
|
|
* This code is licensed under the LGPL.
|
2007-11-17 20:14:51 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ARM_MISC_H
|
|
|
|
#define ARM_MISC_H 1
|
|
|
|
|
2011-07-25 15:27:01 +04:00
|
|
|
#include "memory.h"
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* The CPU is also modeled as an interrupt controller. */
|
|
|
|
#define ARM_PIC_CPU_IRQ 0
|
|
|
|
#define ARM_PIC_CPU_FIQ 1
|
|
|
|
qemu_irq *arm_pic_init_cpu(CPUState *env);
|
|
|
|
|
|
|
|
/* armv7m.c */
|
2011-07-25 15:27:01 +04:00
|
|
|
qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
|
|
|
|
int flash_size, int sram_size,
|
2007-11-17 20:14:51 +03:00
|
|
|
const char *kernel_filename, const char *cpu_model);
|
|
|
|
|
|
|
|
/* arm_boot.c */
|
2008-04-15 00:27:51 +04:00
|
|
|
struct arm_boot_info {
|
|
|
|
int ram_size;
|
|
|
|
const char *kernel_filename;
|
|
|
|
const char *kernel_cmdline;
|
|
|
|
const char *initrd_filename;
|
2009-10-02 01:12:16 +04:00
|
|
|
target_phys_addr_t loader_start;
|
2012-01-26 15:43:48 +04:00
|
|
|
/* 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.
|
|
|
|
*/
|
2009-10-02 01:12:16 +04:00
|
|
|
target_phys_addr_t smp_loader_start;
|
2012-01-14 00:52:40 +04:00
|
|
|
target_phys_addr_t smp_bootreg_addr;
|
2009-11-19 19:45:21 +03:00
|
|
|
target_phys_addr_t smp_priv_base;
|
2008-04-15 00:27:51 +04:00
|
|
|
int nb_cpus;
|
|
|
|
int board_id;
|
2011-06-23 19:53:48 +04:00
|
|
|
int (*atag_board)(const struct arm_boot_info *info, void *p);
|
2012-01-26 15:43:48 +04:00
|
|
|
/* 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 mimicing 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 thei
|
|
|
|
* secondary CPUs to point at this boot blob.
|
|
|
|
*/
|
|
|
|
void (*write_secondary_boot)(CPUState *env,
|
|
|
|
const struct arm_boot_info *info);
|
|
|
|
void (*secondary_cpu_reset_hook)(CPUState *env,
|
|
|
|
const struct arm_boot_info *info);
|
2009-11-11 21:07:53 +03:00
|
|
|
/* Used internally by arm_boot.c */
|
|
|
|
int is_linux;
|
|
|
|
target_phys_addr_t initrd_size;
|
|
|
|
target_phys_addr_t entry;
|
2008-04-15 00:27:51 +04:00
|
|
|
};
|
|
|
|
void arm_load_kernel(CPUState *env, struct arm_boot_info *info);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2008-08-30 13:51:20 +04:00
|
|
|
/* Multiplication factor to convert from system clock ticks to qemu timer
|
|
|
|
ticks. */
|
2008-09-17 23:04:14 +04:00
|
|
|
extern int system_clock_scale;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
#endif /* !ARM_MISC_H */
|