1/* 2 * Misc ARM declarations 3 * 4 * Copyright (c) 2006 CodeSourcery. 5 * Written by Paul Brook 6 * 7 * This code is licensed under the LGPL. 8 * 9 */ 10 11#ifndef ARM_MISC_H 12#define ARM_MISC_H 1 13 14#include "exec/memory.h" 15#include "hw/irq.h" 16 17/* armv7m.c */ 18qemu_irq *armv7m_init(MemoryRegion *system_memory, 19 int flash_size, int sram_size, 20 const char *kernel_filename, const char *cpu_model); 21 22/* arm_boot.c */ 23struct arm_boot_info { 24 uint64_t ram_size; 25 const char *kernel_filename; 26 const char *kernel_cmdline; 27 const char *initrd_filename; 28 const char *dtb_filename; 29 hwaddr loader_start; 30 /* multicore boards that use the default secondary core boot functions 31 * need to put the address of the secondary boot code, the boot reg, 32 * and the GIC address in the next 3 values, respectively. boards that 33 * have their own boot functions can use these values as they want. 34 */ 35 hwaddr smp_loader_start; 36 hwaddr smp_bootreg_addr; 37 hwaddr gic_cpu_if_addr; 38 int nb_cpus; 39 int board_id; 40 int (*atag_board)(const struct arm_boot_info *info, void *p); 41 /* multicore boards that use the default secondary core boot functions 42 * can ignore these two function calls. If the default functions won't 43 * work, then write_secondary_boot() should write a suitable blob of 44 * code mimicking the secondary CPU startup process used by the board's 45 * boot loader/boot ROM code, and secondary_cpu_reset_hook() should 46 * perform any necessary CPU reset handling and set the PC for the 47 * secondary CPUs to point at this boot blob. 48 */ 49 void (*write_secondary_boot)(ARMCPU *cpu, 50 const struct arm_boot_info *info); 51 void (*secondary_cpu_reset_hook)(ARMCPU *cpu, 52 const struct arm_boot_info *info); 53 /* if a board is able to create a dtb without a dtb file then it 54 * sets get_dtb. This will only be used if no dtb file is provided 55 * by the user. On success, sets *size to the length of the created 56 * dtb, and returns a pointer to it. (The caller must free this memory 57 * with g_free() when it has finished with it.) On failure, returns NULL. 58 */ 59 void *(*get_dtb)(const struct arm_boot_info *info, int *size); 60 /* if a board needs to be able to modify a device tree provided by 61 * the user it should implement this hook. 62 */ 63 void (*modify_dtb)(const struct arm_boot_info *info, void *fdt); 64 /* Used internally by arm_boot.c */ 65 int is_linux; 66 hwaddr initrd_start; 67 hwaddr initrd_size; 68 hwaddr entry; 69}; 70void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info); 71 72/* Multiplication factor to convert from system clock ticks to qemu timer 73 ticks. */ 74extern int system_clock_scale; 75 76#endif /* !ARM_MISC_H */ 77