2007-11-17 17:14:51 +00:00
|
|
|
/*
|
|
|
|
* Misc ARM declarations
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006 CodeSourcery.
|
|
|
|
* Written by Paul Brook
|
|
|
|
*
|
2011-06-26 02:21:35 +00:00
|
|
|
* This code is licensed under the LGPL.
|
2007-11-17 17:14:51 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ARM_MISC_H
|
|
|
|
#define ARM_MISC_H 1
|
|
|
|
|
2012-12-17 17:19:49 +00:00
|
|
|
#include "exec/memory.h"
|
2012-10-16 01:57:21 +00:00
|
|
|
#include "hw/irq.h"
|
2011-07-25 11:27:01 +00:00
|
|
|
|
2013-03-18 17:20:07 +00:00
|
|
|
/* The CPU is also modelled as an interrupt controller. */
|
2007-11-17 17:14:51 +00:00
|
|
|
#define ARM_PIC_CPU_IRQ 0
|
|
|
|
#define ARM_PIC_CPU_FIQ 1
|
2012-05-14 02:21:52 +00:00
|
|
|
qemu_irq *arm_pic_init_cpu(ARMCPU *cpu);
|
2007-11-17 17:14:51 +00:00
|
|
|
|
|
|
|
/* armv7m.c */
|
2011-07-25 11:27:01 +00:00
|
|
|
qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
|
|
|
|
int flash_size, int sram_size,
|
2007-11-17 17:14:51 +00:00
|
|
|
const char *kernel_filename, const char *cpu_model);
|
|
|
|
|
|
|
|
/* arm_boot.c */
|
2008-04-14 20:27:51 +00:00
|
|
|
struct arm_boot_info {
|
2012-07-20 12:34:49 +00:00
|
|
|
uint64_t ram_size;
|
2008-04-14 20:27:51 +00:00
|
|
|
const char *kernel_filename;
|
|
|
|
const char *kernel_cmdline;
|
|
|
|
const char *initrd_filename;
|
2012-03-02 11:56:38 +00:00
|
|
|
const char *dtb_filename;
|
2012-10-23 10:30:10 +00:00
|
|
|
hwaddr loader_start;
|
2012-01-26 11:43:48 +00: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.
|
|
|
|
*/
|
2012-10-23 10:30:10 +00:00
|
|
|
hwaddr smp_loader_start;
|
|
|
|
hwaddr smp_bootreg_addr;
|
|
|
|
hwaddr gic_cpu_if_addr;
|
2008-04-14 20:27:51 +00:00
|
|
|
int nb_cpus;
|
|
|
|
int board_id;
|
2011-06-23 15:53:48 +00:00
|
|
|
int (*atag_board)(const struct arm_boot_info *info, void *p);
|
2012-01-26 11:43:48 +00: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
|
2012-05-28 04:11:49 +00:00
|
|
|
* code mimicking the secondary CPU startup process used by the board's
|
2012-01-26 11:43:48 +00:00
|
|
|
* boot loader/boot ROM code, and secondary_cpu_reset_hook() should
|
2012-05-28 04:11:49 +00:00
|
|
|
* perform any necessary CPU reset handling and set the PC for the
|
2012-01-26 11:43:48 +00:00
|
|
|
* secondary CPUs to point at this boot blob.
|
|
|
|
*/
|
2012-05-13 22:08:10 +00:00
|
|
|
void (*write_secondary_boot)(ARMCPU *cpu,
|
2012-01-26 11:43:48 +00:00
|
|
|
const struct arm_boot_info *info);
|
2012-05-13 23:05:40 +00:00
|
|
|
void (*secondary_cpu_reset_hook)(ARMCPU *cpu,
|
2012-01-26 11:43:48 +00:00
|
|
|
const struct arm_boot_info *info);
|
2009-11-11 18:07:53 +00:00
|
|
|
/* Used internally by arm_boot.c */
|
|
|
|
int is_linux;
|
2012-10-26 15:29:38 +00:00
|
|
|
hwaddr initrd_start;
|
2012-10-23 10:30:10 +00:00
|
|
|
hwaddr initrd_size;
|
|
|
|
hwaddr entry;
|
2008-04-14 20:27:51 +00:00
|
|
|
};
|
2012-05-14 00:39:57 +00:00
|
|
|
void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
|
2007-11-17 17:14:51 +00:00
|
|
|
|
2008-08-30 09:51:20 +00:00
|
|
|
/* Multiplication factor to convert from system clock ticks to qemu timer
|
|
|
|
ticks. */
|
2008-09-17 19:04:14 +00:00
|
|
|
extern int system_clock_scale;
|
2007-11-17 17:14:51 +00:00
|
|
|
|
|
|
|
#endif /* !ARM_MISC_H */
|