1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright (c) 2013 Joyent, Inc. All rights reserved. 14 */ 15 16 #ifndef _FAKELOADER_H 17 #define _FAKELOADER_H 18 19 /* 20 * The hacky version of arm uniboot that is exactly for a few systems. 21 */ 22 23 #include <sys/stdint.h> 24 #include <sys/atag.h> 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 typedef struct fakeloader_hdr { 31 unsigned char fh_magic[4]; /* Magic! */ 32 uint32_t fh_unix_size; /* How large is unix */ 33 uint32_t fh_unix_offset; /* Offset from start to unix */ 34 uint32_t fh_archive_size; /* How large is the archive */ 35 uint32_t fh_archive_offset; /* Offset from start to archive */ 36 } fakeloader_hdr_t; 37 38 #define FH_MAGIC0 'i' 39 #define FH_MAGIC1 'f' 40 #define FH_MAGIC2 'b' 41 #define FH_MAGIC3 'h' 42 43 /* 44 * Backend operations, eg. what a given board must implement at the moment 45 */ 46 extern void fakeload_backend_init(void); 47 extern void fakeload_backend_putc(int); 48 extern void fakeload_backend_addmaps(atag_header_t *); 49 50 /* 51 * ASM operations 52 */ 53 extern void fakeload_unaligned_enable(void); 54 extern void fakeload_mmu_enable(void); 55 extern void fakeload_pt_setup(uintptr_t); 56 extern void fakeload_exec(uintptr_t); 57 58 extern void armv6_dcache_disable(void); 59 extern void armv6_dcache_enable(void); 60 extern void armv6_dcache_inval(void); 61 extern void armv6_dcache_flush(void); 62 63 extern void armv6_icache_disable(void); 64 extern void armv6_icache_enable(void); 65 extern void armv6_icache_inval(void); 66 67 #ifdef __cplusplus 68 } 69 #endif 70 71 #endif /* _FAKELOADER_H */