2004-05-14 11:46:45 +00:00
|
|
|
/* $NetBSD: machdep.h,v 1.7 2002/02/21 02:52:21 thorpej Exp $ */
|
|
|
|
/* $FreeBSD$ */
|
|
|
|
|
|
|
|
#ifndef _MACHDEP_BOOT_MACHDEP_H_
|
|
|
|
#define _MACHDEP_BOOT_MACHDEP_H_
|
|
|
|
|
2012-09-22 06:41:56 +00:00
|
|
|
/* Structs that need to be initialised by initarm */
|
2013-03-29 18:43:10 +00:00
|
|
|
struct pv_addr;
|
2012-09-22 06:41:56 +00:00
|
|
|
extern struct pv_addr irqstack;
|
|
|
|
extern struct pv_addr undstack;
|
|
|
|
extern struct pv_addr abtstack;
|
|
|
|
|
|
|
|
/* Define various stack sizes in pages */
|
|
|
|
#define IRQ_STACK_SIZE 1
|
|
|
|
#define ABT_STACK_SIZE 1
|
|
|
|
#define UND_STACK_SIZE 1
|
|
|
|
|
2004-05-14 11:46:45 +00:00
|
|
|
/* misc prototypes used by the many arm machdeps */
|
2013-03-29 18:43:10 +00:00
|
|
|
struct trapframe;
|
Instead of using sysarch() to store-retrieve the tp, add a magic address,
ARM_TP_ADDRESS, where the tp will be stored. On CPUs that support it, a cache
line will be allocated and locked for this address, so that it will never go
to RAM. On CPUs that does not, a page is allocated for it (it will be a bit
slower, and is wrong for SMP, but should be fine for UP).
The tp is still stored in the mdthread struct, and at each context switch,
ARM_TP_ADDRESS gets updated.
Suggested by: davidxu
2005-02-26 18:59:01 +00:00
|
|
|
void arm_lock_cache_line(vm_offset_t);
|
2012-06-10 01:13:04 +00:00
|
|
|
void init_proc0(vm_offset_t kstack);
|
2008-04-03 16:44:50 +00:00
|
|
|
void halt(void);
|
2013-03-29 18:43:10 +00:00
|
|
|
void data_abort_handler(struct trapframe *);
|
|
|
|
void prefetch_abort_handler(struct trapframe *);
|
2012-09-22 06:41:56 +00:00
|
|
|
void set_stackptrs(int cpu);
|
2013-03-29 18:43:10 +00:00
|
|
|
void undefinedinstruction_bounce(struct trapframe *);
|
2012-06-14 04:18:56 +00:00
|
|
|
|
|
|
|
/* Early boot related helper functions */
|
2012-06-14 04:00:30 +00:00
|
|
|
struct arm_boot_params;
|
2012-06-14 04:09:20 +00:00
|
|
|
vm_offset_t default_parse_boot_param(struct arm_boot_params *abp);
|
2012-06-14 04:16:16 +00:00
|
|
|
vm_offset_t freebsd_parse_boot_param(struct arm_boot_params *abp);
|
|
|
|
vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp);
|
2012-06-14 04:09:20 +00:00
|
|
|
vm_offset_t fake_preload_metadata(struct arm_boot_params *abp);
|
|
|
|
vm_offset_t parse_boot_param(struct arm_boot_params *abp);
|
2014-02-26 22:06:10 +00:00
|
|
|
void arm_generic_initclocks(void);
|
2012-06-14 04:00:30 +00:00
|
|
|
|
2013-11-05 02:57:34 +00:00
|
|
|
/*
|
|
|
|
* Initialization functions called by the common initarm() function in
|
|
|
|
* arm/machdep.c (but not necessarily from the custom initarm() functions of
|
|
|
|
* older code).
|
|
|
|
*
|
|
|
|
* - initarm_early_init() is called very early, after parsing the boot params
|
|
|
|
* and after physical memory has been located and sized.
|
|
|
|
*
|
2013-11-24 22:01:15 +00:00
|
|
|
* - initarm_devmap_init() is called as one of the last steps of early virtual
|
2013-11-05 02:57:34 +00:00
|
|
|
* memory initialization, shortly before the new page tables are installed.
|
|
|
|
*
|
2013-11-24 22:01:15 +00:00
|
|
|
* - initarm_lastaddr() is called after initarm_devmap_init(), and must return
|
2013-11-05 02:57:34 +00:00
|
|
|
* the address of the first byte of unusable KVA space. This allows a
|
|
|
|
* platform to carve out of the top of the KVA space whatever reserves it
|
|
|
|
* needs for things like static device mapping, and this is called to get the
|
|
|
|
* value before calling pmap_bootstrap() which uses the value to size the
|
|
|
|
* available KVA.
|
|
|
|
*
|
|
|
|
* - initarm_gpio_init() is called after the static device mappings are
|
|
|
|
* established and just before cninit(). The intention is that the routine
|
|
|
|
* can do any hardware setup (such as gpio or pinmux) necessary to make the
|
|
|
|
* console functional.
|
|
|
|
*
|
|
|
|
* - initarm_late_init() is called just after cninit(). This is the first of
|
|
|
|
* the init routines that can use printf() and expect the output to appear on
|
|
|
|
* a standard console.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void initarm_early_init(void);
|
|
|
|
int initarm_devmap_init(void);
|
2012-09-23 03:46:03 +00:00
|
|
|
vm_offset_t initarm_lastaddr(void);
|
|
|
|
void initarm_gpio_init(void);
|
|
|
|
void initarm_late_init(void);
|
2012-11-03 22:39:07 +00:00
|
|
|
|
2013-01-05 23:08:10 +00:00
|
|
|
/* Board-specific attributes */
|
|
|
|
void board_set_serial(uint64_t);
|
|
|
|
void board_set_revision(uint32_t);
|
|
|
|
|
2004-05-14 11:46:45 +00:00
|
|
|
#endif /* !_MACHINE_MACHDEP_H_ */
|